Northern Wei

Northern Wei (386-535 CE) was a Xianbei dynasty of China established in 386 by Emperor Daowu of Northern Wei. It unified northern China during the Northern and Southern Dynasties period, and they had Buddhism as their state religion after 450 CE. Wei divided into Eastern Wei and Western Wei in 535 CE after some infighting.

History
The Tuoba tribe of the Xianbei assisted Eastern Jin in its wars against the other barbarian tribes that invaded China during the Uprising of the Five Barbarians after 305 CE, and in 391 the Tuoba leader Tuoba Gui defeated and killed Heduohan, chief of the Rouran, and forced the Rouran to flee west. Northern Wei was declared by Tuoba Gui, and in 398 the dynasty took over most of the Later Yan's lands north of the Yellow River. Northern Wei became a Chinese dynasty when Cui Hao helped with the implementation of Han Chinese administrative systems and penal codes, while Taoism was the state religion until 450. In 494 the capital moved to Luoyang, the former Eastern Jin capital, after Northern Wei united northern China under its rule in the Northern and Southern Dynasties period. In 475, they bordered the Liu Song dynasty to the south, and in 500 they faced Southern Qi to the south. Northern Wei also fought the Rouran to the north, and in 523 six garrison towns to the north rebelled against Northern Wei. In 528, 2,000 courtiers were massacred by Northern Wei general Erzhu Rong, who placed Emperor Xiaozhuang of Northern Wei on the throne. Similar to Dong Zhuo, Erzhu Rong was a tyrant, and his family later killed Xiaozhuang in 531 CE. In 535, Emperor Xiaowu of Northern Wei was poisoned by general Yuwen Tai after they had a falling-out over Yuwen's incest with his cousins, and Northern Wei split into Eastern Wei and Western Wei.

Culture
Northern Wei was a multicultural society consisting of both the Xianbei elite and the Han Chinese inhabitants of China. Taoism was the main belief as a theocracy until 450 CE, when Buddhism was adopted as the new state religion. "The Parade of the Buddhas" and many other works of art were composed under Northern Wei, which was influential in the spread of Buddhism to China.