 By 386, Tuoba Gui, the son (or grandson) of Tuoba Shiyijian (the last Prince of Dai), reasserted Tuoba independence initially as the Prince of Dai.Later he changed his title to the Prince of Wei, and his state was therefore known as Northern Wei.In 391, Tuoba Gui defeated the Rouran tribes and killed their chief, Heduohan, forcing the Rouran to flee west.