The military actions that Emperor Wu Di engaged in against the Xiong Nu weakened the empire both financially and politically. By the time Emperor Yuan Di ruled (48-33 BC), the governing bureaucracy, now controlled by the emperor's relatives on his mother's side, had become so corrupt that it threatened to take down the whole empire. This power shift from the emperor to his mother's family, considered dangerous and illegitimate, took place when Emperor Yuan Di died; and his son succeeded him as Emperor Cheng Di (r. 32-36 BC), and made his mother Wang Zhengjun the "Queen Mother," promoting all his maternal uncles to important positions in government.
One of the emperor's uncles had a son named Wang Mang. Wang Mang harbored major ambitions for power, and knew he must prepare himself intellectually and politically for his aspirations. He spent years growing closer to his uncle Wang Feng, whom the emperor had granted military importance; so that when his uncle grew old and retired, he would be the one to succeed him. He did indeed end up succeeding Wang Feng, and power was now in his hands，One other move Wang Mang had made to fulfill his ambitions involved building a support network of those who would help him when needed. He helped his friends enter the government and shared so much of his fortune with them that he himself lived most frugally.
Some time after Emperor Ai Di had ascended the throne in 6 BC, Wang Mang found the gate to power was shut to him. But, after the death of Emperor Ai Di, he was again on the rise; and Wang Zhengjun, as the grandmother of the former emperor, helped him to crown Emperor Ping Di (r. AD 1-5). Wang Mang gave his daughter in marriage to the new emperor, so that, as his father-in-law, he acquired still more power and influence in the government. In AD 5, Wang Mang poisoned the 14-year-old Emperor Ping Di, his son-in-law. He then coerced his aunt, Queen Mother Wang Zhengjun, into agreeing to his managing the state affairs on behalf of the throne while the throne remained vacant. In the same year, as Wang Mang had started to rule as "Regent," he made a 2-year-old boy from the royal family the crown prince, giving the impression that he was merely taking care of the throne for its legitimate heir until he grew up and was mature enough to take over. All he, in reality, wanted was to take over himself. So he sent a cousin to his aunt Wang Zhengjun for the official seal of the emperor. Full of emotion and indignation, the queen dowager confronted her nephew, accusing him of ungratefulness for all the Han-dynasty royal family had done for the Wang family. But the elderly lady knew she would be unable to hold onto the seal. In the end she had to surrender it, crying bitterly at the outrage.
Early in AD 9, Wang Mang crowned himself as the emperor, changing the dynastic name for the empire from Han to Xin, and officially taking over the sovereignty of what historians refer to as the Western Han Dynasty.