After suffering several defeats by the end of the Three Kingdoms period, the Xianbei migrated south and settled in close proximity to Chinese society and submitted as vassals, being granted the titles of Dukes. As the Xianbei Murong, Tuoba, and Duan tribes were one of the Five Barbarians who were vassals of the Han Chinese Western Jin and Eastern Jin dynasties, they took part in the Uprising of the Five Barbarians as allies of the Han Chinese Eastern Jin against the other four barbarians, the Xiongnu, Jie, Di and Qiang.