From 206 to 202 BC, Liu Bang engaged Xiang Yu in a power struggle – historically known as the
Chu–Han Contention – for supremacy, while simultaneously attacking and subjugating the other kingdoms.
Conquest of the Three Qin Liu Bang's migration to
Hanzhong was far from pleasant. His followers were mostly from the
Wu and
Chu flatland regions so they could not adapt well to the mountainous terrain in Bashu. Moreover, there were many deserters every day. Liu also grew temperamental as he was very unhappy with his own predicament. One night, upon hearing a rumour that
Xiao He had abandoned him, Liu almost had a nervous breakdown. When Xiao returned the following morning, Liu confronted him and demanded an explanation. Xiao revealed that he had left in a hurry after learning that
Han Xin had deserted. Among all the deserters, Xiao was convinced that Liu could not afford to lose a talent like Han Xin, so that was why he had chosen to go after Han Xin only, and bring him back. Xiao then introduced Liu to Han Xin, who laid out his strategic plan to conquer the states. Impressed and convinced, Liu formally appointed Han Xin as a general of his army. Meanwhile, Xiang Yu's overbearing and arbitrary assignment of the
Eighteen Kingdoms had caused much resentment among the former rebel leaders. Merely four months after Liu left for Bashu, a rebellion broke out in the
Qi territories in late 206 BC, prompting Xiang Yu to lead his troops to suppress the revolt. On Han Xin's advice, Liu sent his men to pretend to rebuild the gallery roads while secretly dispatching Han Xin with an army to attack the
Three Qins via another route through
Chencang. Han Xin took
Zhang Han, one of the rulers of the Three Qins, by surprise and defeated him in battle. After that, the other two rulers decided to surrender to Liu. By August or September 205 BC, the Three Qins and the Guanzhong region had come under Liu's control.
Defeat at Pengcheng While Xiang Yu was busy suppressing the rebellion in the
Qi lands, Liu gathered an army of 560,000 from the Bashu and Guanzhong regions and marched east to attack Western Chu. En route, he encountered
Peng Yue, who joined his cause upon promise of a fiefdom in the
Wei territories. Liu then ordered Peng Yue to lead his 30,000 men to
pacify the surrounding areas, while he led his 560,000 troops into Pengcheng (; present-day
Xuzhou,
Jiangsu), the Western Chu capital, apparently unopposed. Due to lack of military discipline, Liu's soldiers looted and pillaged Pengcheng after occupying it. Upon learning of the fall of Pengcheng, Xiang Yu left the bulk of his forces to continue fighting in Qi, while he personally led 30,000 elite troops to retake his capital. He made camp about ten
li near present-day
Xiao County,
Anhui, and attacked Pengcheng at dawn. By noon, Xiang Yu had routed Liu's unprepared forces, driving them towards the nearby Gu and Si rivers, where over 100,000 men drowned or were killed by Chu soldiers. The remaining Han forces fled south to higher ground but were trapped by Chu forces near the Sui River, where another 100,000 men lost their lives and their corpses even blocked the river flow. Liu escaped Pengcheng with only a dozen horsemen and headed to Pei County to fetch his family. Xiang Yu also sent troops to Pei County to capture Liu's family, but they had all fled earlier. Xiang Yu's men coerced a local into revealing the whereabouts of Liu's family, and managed to capture Liu's parents and Liu's wife
Lü Zhi. En route, Liu encountered his and Lü Zhi's children –
Princess Yuan and
Liu Ying – and picked them up in his carriage, which was driven by
Xiahou Ying. In his desperation to escape and lighten the load, Liu attempted thrice to push his children out of the carriage and abandon them. However, each time, Xiahou Ying stopped him and saved the children.
Battle of Jingsuo After their disastrous defeat at Pengcheng, the strength of the Han forces decreased drastically. Many of the kings who had surrendered to Liu earlier defected to Xiang Yu's side. Moreover, the states of
Qi and
Zhao, which were previously at war with Western Chu, also requested to make peace. Upon reaching Xiayi (; east of present-day
Dangshan County,
Anhui), Liu regrouped his forces and prepared for a treat. When he arrived at
Yu County, he sent an envoy to meet
Ying Bu, the King of
Jiujiang, to seek his support. Ying Bu, who had already been holding a grudge against Xiang Yu over the latter's unfair assignment of the
Eighteen Kingdoms, agreed to side with Liu. In response to Ying Bu's betrayal, Xiang Yu sent
Long Ju with an army to attack Jiujiang. In 205 BC, Liu designated his son
Liu Ying as
crown prince and stationed him in
Yueyang. Shortly after, Liu's forces attacked and captured Feiqiu (; present-day
Xingping,
Shaanxi);
Zhang Han, the King of Yong, committed suicide after his defeat. In the south, Ying Bu failed to resist Long Ju's attack so he gave up on Jiujiang and went to join Liu. Liu reorganised his forces – incorporating reinforcements from the
Guanzhong region – and marched east to attack Xiang Yu again at Jing and Suo counties, both around present-day
Xingyang,
Henan. The battle was historically known as the Battle of Jingsuo. Liu emerged victorious and drove Xiang Yu's forces eastward out of Xingyang.
Battle of Chenggao and Treaty of Hong Canal In 204 BC, after sustaining losses from Chu attacks on his supply routes to
Xingyang, Liu's forces began to run short of supplies so Liu requested to make peace with Xiang Yu, agreeing to cede the lands east of Xingyang to Xiang Yu. Initially, Xiang Yu wanted to accept Liu's offer but his adviser
Fan Zeng urged him to reject it and use the opportunity to attack and destroy Liu. Xiang Yu thus changed his mind, pressed the attack on Xingyang, and besieged Liu inside the city. Liu heeded
Chen Ping's suggestion to use 40,000
catties of gold to bribe some of Xiang Yu's men and get them to spread rumours that Fan Zeng had the intention of betraying Xiang Yu. Xiang Yu fell for the ruse and dismissed Fan Zeng. Later that year, while Xiang Yu was away suppressing a rebellion in
Qi territories, Liu seized the chance to attack and conquer
Chenggao, defeating Xiang Yu's forces led by
Cao Jiu near the
Si River. Liu then advanced further east until he reached Guangwu (), trapping Xiang Yu's forces under
Zhongli Mo in the area. Following
Han Xin's victory against the allied forces of Chu and Qi at the
Battle of Wei River in the north, the morale of the Chu forces fell and they started running short of supplies months later. Xiang Yu had no choice but to request to make peace with Liu, offering to release Liu's family members whom he had captured earlier and had been holding hostage. Both sides agreed to a ceasefire and to give the west to Han and the east to Chu, with the dividing line along the Hong Canal, which runs through present-day
Zhengzhou, Xingyang and
Zhongmu in
Henan; this agreement was also historically known as the Treaty of Hong Canal ().
Battle of Gaixia In 203 BC, while Xiang Yu was retreating eastwards, Liu, acting on
Zhang Liang and
Chen Ping's advice, renounced the peace agreement and prepared to attack Xiang Yu. He also sent messengers to meet
Han Xin and
Peng Yue, seeking their assistance to launch a coordinated attack on Xiang Yu from three directions. However, Han Xin and Peng Yue failed to mobilise their forces, so Liu ended up being defeated by Xiang Yu at Guling (; south of present-day
Taikang County,
Henan). After retreating and reinforcing his defences, Liu sent word to Han Xin and Peng Yue again, promising to award them fiefs and noble titles if they joined him in attacking Xiang Yu. They finally agreed this time. Three months later in 202 BC, the combined forces of Liu, Han Xin and Peng Yue attacked Xiang Yu from three directions. Running low on supplies, Xiang Yu and his forces found themselves trapped in Gaixia (in present-day
Anhui). There, Han Xin ordered his troops to sing folk songs from the Chu lands to evoke feelings of nostalgia among Xiang Yu's men – who were mostly from Chu – and create the impression that many Chu soldiers had surrendered and joined the opposing side. The morale of Xiang Yu's forces plummeted and many of his soldiers deserted. Xiang Yu attempted to fight his way out but encountered several ambushes along the way. Eventually, he was left with only 28 men when he reached the northern bank of the Wu River (; near present-day
He County, Anhui), where he made a last stand and managed to slay over a hundred enemy soldiers before committing suicide by slitting his throat. == Founding of the Han dynasty ==