In the Sixteen Kingdoms period, the Tuoba family of the Xianbei were the rulers of the state of Dai (Sixteen Kingdoms). Although it was conquered by the Former Qin, the defeat of the Former Qin at the Battle of Fei River resulted in the collapse of the Former Qin. The grandson of the last prince of Dai Tuoba Shiyijian, Tuoba Gui restored the fortunes of the Tuoba clan, renaming his state Wei (now known as Northern Wei) with its capital at Shengle (near modern Hohhot). Under the rule of Emperors Daowu (Tuoba Gui), Mingyuan, and Taiwu, the Northern Wei progressively expanded. The establishment of the early Northern Wei state and the economy were also greatly indebted to the father-son pair of Cui Hong and Cui Hao. Tuoba Gui engaged in numerous conflicts with the Later Yan that ended favorably for the Northern Wei after they received help from Zhang Gun that allowed them to destroy the Later Yan army at the Battle of Canhe Slope. Following this victory, Tuoba Gui conquered the Later Yan capital of Pingcheng (modern-day Datong). That same year he declared himself Emperor Daowu.