After Emperor Xiaowen of the Northern Wei Dynasty died, Yuan Ke inherited the throne, becoming Emperor Xuanwu of the Northern Wei. From the time Yuan Ke took power, the Northern Wei began to gradually decline. After Yuan Ke's death, the five-year-old Yuan Xu inherited the throne, becoming Emperor Xiaoming. Because Yuan Xu was too young, the power of the court fell into the hands of Yuan Xu's mother, Empress Dowager Hu.
Empress Dowager Hu was an extremely extravagant and wasteful person. She was a devout follower of Buddhism, and to demonstrate her piety to the Buddha, she ordered the construction of Yongning Temple right next to the imperial palace. This Buddhist temple was magnificent, housing statues of the Buddha carved from white jade and cast in gold, with one statue reaching an astonishing height of eighteen feet. The temple complex contained as many as a thousand rooms, all adorned with pearls, jade, and fine brocades. She also had a nine-story pagoda built beside the temple, which stood ninety zhang tall. At night, when the wind blew, the bells on the pagoda could be heard from ten li away. Furthermore, she commissioned the excavation of cave temples and the construction of Buddha statues, draining enormous amounts of manpower and resources.
Once, Empress Dowager Hu accidentally visited the imperial treasury and discovered a vast amount of silk and satin there, all wealth that previous rulers of the Northern Wei Dynasty had extorted from the common people. However, Empress Dowager Hu did not take this wealth seriously at all. She decided to make fun of her ministers with the silk and satin, so she sent someone to inform them that she would distribute the treasury's silk and satin as rewards. The ministers were overjoyed upon hearing this. But then, Empress Dowager Hu added that each person could only take as much as they could carry with their own strength—the strong could take more, and the weak could only take less. These ministers were all extremely greedy and wanted to take as much as possible. However, they were used to having servants attend to their every need, leaving them physically weak and utterly lacking in strength, so they could barely carry anything. Yuan Rong, the Prince of Zhangwu, and Li Chong, the Chief Minister, both loaded themselves with bolts of silk, but before they could take two steps, they fell to the ground—one injuring his leg, the other his back. Seeing their pitiful state, Empress Dowager Hu burst into laughter and ordered that all the silk they had carried be taken back. Everyone inside and outside the palace, upon witnessing their embarrassing spectacle, also joined in the laughter.
Under the influence of Empress Dowager Hu, the noble ministers of Northern Wei also grew extravagant, taking pride in flaunting their wealth. The Prince of Hejian, Yuan Chen, invited his colleagues to drink at his home, using vessels made of agate or crystal, all of which were extremely costly. Besides drinking, Yuan Chen also took everyone to tour his warehouse, where they saw it piled high with gold, silver, and silk brocades, leaving them all secretly envious.
Yuan Chen said to Zhangwu Wang Yuan Rong, "Everyone says that Shi Chong of the Jin Dynasty was extremely wealthy, but I wonder what expression he would have on his face if he saw my riches." Yuan Rong felt that he was not as wealthy as Yuan Chen and was so upset that he could not even get out of bed.
Prince Yuanyong of Gaoyang possessed wealth no less than that of Yuanchen. His residence and gardens were built with the same splendor as the imperial palace, with five hundred musicians and six thousand servants in his household, and a single meal cost tens of thousands in cash.
In order to amass more wealth, many officials began to accumulate money without restraint. When Yuan Hui served as the Minister of Personnel, he even openly sold official positions and titles, with each post clearly marked with a price.
Central officials were like this, and local prefectural and commandery officials were not much better. Local governors and inspectors used heavy scales, large bushels, and long rulers to collect taxes, making it extremely difficult for large numbers of farmers to survive, and many farmers became monks to escape the heavy tax burdens. As a result, the number of registered households under the Northern Wei government's control steadily decreased, severely impacting government revenue. To recover their losses, the Northern Wei ruling class, on one hand, increased taxes on farmers who had not fled, and on the other hand, launched large-scale searches to capture escaped farmers.
As the contradictions between the peasant class and the ruling class continued to deepen, in 523 AD, the "Six Garrisons Uprising" broke out within the Northern Wei Dynasty. Although the uprising was eventually suppressed, the Northern Wei government paid a very heavy price, as internal turmoil erupted within the ruling class, Emperor Xiaoming was poisoned to death, and the real power of the Northern Wei fell into the hands of the generals Yuwen Tai and Gao Huan.
In 532 AD, Gao Huan, based in Jinyang (present-day southwest of Taiyuan, Shanxi), remotely manipulated the regime of the Northern Wei Dynasty. At that time, the emperor of Northern Wei was Emperor Xiaowu, Yuan Xiu. Dissatisfied with Gao Huan's actions, Yuan Xiu appointed Yuwen Tai as Attendant, General of Agile Cavalry, and Grand Commander of Guanzhong, sending him to mobilize troops and prepare for an expedition against Gao Huan. However, Gao Huan did not sit idly by; under the pretext of purging the emperor's side, he assembled a large army and advanced toward Luoyang. Emperor Xiaowu personally led 100,000 troops to station at Heqiao (south of present-day Meng County, Henan) and constructed defensive fortifications at the northern foot of Mount Mang (north of present-day Luoyang, Henan) to resist Gao Huan's forces. When news of Gao Huan's siege of Luoyang reached Yuwen Tai, he publicly denounced Gao Huan's crimes, dispatched his general Li Xian with 1,000 cavalry to reinforce Luoyang, sent general Zhao Gui with a large army to attack Gao Huan's stronghold in Bingzhou, ordered acting minister Changsun Yanzhen to guard Shancheng (south of present-day Sanmenxia, Henan), and personally led his main force to attack Hongnong (south of present-day Lingbao, Henan). To defend against Gao Huan's army, Yuan Xiu sent Grand Commander and Prince of Yingchuan, Yuan Bin, acting minister Changsun Zhijian, and Hu Sizheng to lead troops to hold Hulao Pass. Subsequently, Gao Huan crossed the Yellow River with his army, drawing ever closer to Luoyang, plunging the city into a critical situation. Yuan Xiu summoned his ministers to discuss how to deal with Gao Huan's forces. The ministers offered various opinions: some advocated staying in Luoyang to fight to the death, others suggested abandoning Luoyang and retreating west into Guanzhong, and still others proposed leaving Luoyang to seek refuge with Heba Sheng in the south. Before Yuan Xiu could make a final decision, Prince Yuan Bin of Yingchuan returned to Luoyang from the front. He had clashed with Hu Sizheng over command authority and, failing to gain the upper hand, angrily left the front to seek Yuan Xiu's intervention. He fabricated a story, claiming that Gao Huan's army had already reached the front lines. Alarmed, Yuan Xiu immediately ordered Hu Sizheng to withdraw his troops to Luoyang, while he himself, protected by over 5,000 cavalry, fled Luoyang and headed west toward Chang'an. When they reached the Xiaoshan Road (northwest of present-day Luoning, Henan), Yuan Xiu encountered the reinforcements sent by Yuwen Tai to Luoyang and proceeded together to Chang'an.

Gao Huan led his large army into Luoyang without much trouble. There, he installed Yuan Shanjian, the heir of the Prince of Qinghe, as emperor, changed the reign title to Tianping, and moved the capital from Luoyang to Yecheng (southwest of present-day Linzhang, Hebei). This regime is historically referred to as the Eastern Wei.
Shortly after, Emperor Xiaowu Yuan Xiu passed away in Chang'an, so Yuwen Tai installed Yuan Baoju as emperor and changed the era name to Datong. This regime is historically referred to as the Western Wei Dynasty. At this point, the Northern Wei Dynasty split and was replaced by the Eastern Wei and Western Wei.