information:classification, structural:summarization, stylistic:tone, linguistic:voice_change
Northern Wei and the reunification of northern China

The ancestral home of the Tuoba Xianbei was the Greater Khingan range of Inner Mongolia. In 258, the clan migrated south to the Yin Mountains and spread into the Ordos Loop region. In 315, chief Tuoba Yilu was recognized as the Prince of Dai by the Jin Emperor. In 338, Tuoba Shiyijian formally declared Dai's independence and built the capital at Shengle (modern day Horinger County, Hohhot). In 376, the Former Qin attacked Shengle and drove the Tuoba into the northern steppes; Tuoba Shiyijian was killed by his son.

In 386, Tuoba Shiyijian's grandson Tuoba Gui revived the kingdom, which he renamed Wei; it is known to historians as the Northern Wei. From near Hohhot, Tuoba Gui expanded southward, capturing Shanxi and Hebei from the Former Yan and Henan from the Liu Song dynasty. In 398, he moved the capital to Pingcheng (modern day Datong) and declared himself the Emperor Daowu. In 423, Tuoba Gui's grandson Tuoba Tao took the throne as Emperor Taiwu and began the quest to unify the North. Under his leadership, the Northern Wei subdued the Rouran nomads to the north and began the conquest of Shaanxi, Ningxia, and Gansu. In 427, he captured the Xia capital, Tongwancheng in modern-day Jingbian County, Shaanxi.

The Xia under Helian Ding moved to Pingliang, Gansu and conquered the Western Qin at Jincheng (modern day Lanzhou) in 431. Helian Ding sought an alliance with the Liu Song dynasty but was driven further west by the Northern Wei. Helian Ding wanted to invade the Northern Liang but was captured in a raid by the Tuyuhun nomads and executed by the Northern Wei. In 436, the Tuoba Tao, as Emperor Taiwu, led an expedition against the Northern Yan. Feng Hong, the younger brother of Feng Ba, fled to Goguryeo, where he was killed. The last ruler of the Northern Liang, Juqu Mujian, surrendered in 439, completing the Northern Wei's unification of northern China and marking the end of the Sixteen Kingdoms period. The Tuobas were eventually Sinicized, changing their name to Yuan, and held northern China through the 550s.

Chinese history then entered the Northern and Southern Dynasties period as parallel series of dynasties in the North and South co-existed until the Sui dynasty united the country in 589.