In 407, after suffering a number of losses against Northern Wei, Yao Xing decided to make peace with Northern Wei. Upon hearing this, Liu Bobo became angry, because his father had been killed by Northern Wei, and he planned rebellion. He therefore forcibly seized the horses that Yujiulü Shelun (郁久閭社崙), the khan of Rouran, had recently offered to Yao Xing as a tribute, and then made a surprise attack on his father-in-law Mo Yigan, capturing Gaoping and killing Mo, seizing his troops. He then declared himself a descendant of Yu the Great, the founder of Xia Dynasty, and named his state Xia. He claimed the title "Heavenly King" ("Tian Wang").