After the fall of the Qin dynasty, Liu Bang received the title of "King of Han" from Xiang Yu, and was relocated to Hanzhong.
In 202 BC, Liu Bang defeated Xiang Yu at the Battle of Gaixia and unified China under his rule.