By the end of the Xin Dynasty, peasants all over the country rebelled against Wang Mang for the years of his incompetent rule. Calls for the reestablishment of the Han Dynasty, which Wang Mang overthrew, was on the rise. Heeding these voices, the leaders of the rebellions supported to be the emperor of the new Han Dynasty.
Xin Emperor Wang Mang decided that he must crush the newly constituted Han regime before the new regime gained momentum, and sent his cousin Wang Yi and his prime minister Wang Xun with what he considered to be overwhelming force, some 430,000 men, to attack the Han forces. The Han forces were split in two — one led by Wang Feng, Wang Chang, and Liu Xiu; while the other, the majority, was led by . Wang Feng, Wang Chang, and Liu Xiu soon took the castles of Kunyang , Dingling , and Yanxian . Liu Xiu's forces had started attacking Yangguan , but after hearing of the arrival of the main Xin forces, he decided to retreat to Kunyang. The nine thousand rebels in Kunyang, vastly outnumbered by the Xin force, initially wanted to scatter and retreat to Jingzhou, but Liu Xiu opposed it. He advocated that they guard Kunyang securely, since a scattered army would be easy prey. Liu Xiu promised to gather all other available troops in surrounding areas and attack the Xin forces from the outside. After initially rejecting Liu Xiu's idea, the rebels eventually agreed.
With the Xin forces approaching Kunyang from the north, Liu Xiu led 13 horsemen out of Kunyang at night to rally for reinforcements from Dingling and Yanxian.
The Xin commander, Wang Yi, confident of his overwhelming numbers, stated that his army would "annihilate all in his path, massacre the town, and dance in its blood" and laid siege to the town. Faced with siege towers and tunnels dug under its castle walls, Kunyang's defenses held on until Liu Xiu returned with ten thousand footmen and cavalry on July 7. By then, the Xin forces' morale was dropping while the Han forces' morale was booming with Liu's return. Liu Xiu took this chance to lead a thousand men to engage the Xin forces, while another brigade of 3000 marched around to the rear of the Xin army and attacked the Xin main camp. Wang Yi, still underestimating the Han forces, led ten thousand men with Wang Xun to meet the enemy while ordering the rest of his troops to stand ground unless he orders them to attack. Once they engaged in battle, however, after minor losses, the other units were hesitant to assist them, and Liu Xiu killed Wang Xun in battle. Once that happened, the Han forces inside Kunyang burst out of the city and attacked the other Xin units, and the much larger Xin forces suffered a total collapse. Adding to the misery of the Xin forces is a sudden rainstorm which caused a flashflood drowning many of the fleeing men.
Unable to gather most of his men, Wang Yi had to withdraw with the remaining several thousand men back to Luoyang. Once the news about the battle of Kunyang spread throughout the empire, the people rose everywhere else simultaneously, often killing the local government officials and claiming to be officials under the new Han regime. Within a month, nearly the entire empire slipped out of Xin control.