In the first year of the Han Dynasty (206 BC), after Xiang Yu entered the customs, he sent someone to report to Chu Huaiwang and ask for instructions on sealing the king. Chu Huaiwang adhered to the previous covenant: "The one who enters the customs first and settles down is king", and appointed Liu Bang to rule Guanzhong. Xiang Yu was furious at this, and still honored Chu Huaiwang as the nominal righteous emperor, and let him still live in Xuyi (now the northeast of Xuyi, Jiangsu). In February, Xiang Yu established himself as the overlord of Western Chu, in charge of 9 counties of Liangchu, with Pengcheng (now Xuzhou, Jiangsu) as its capital, and enfeoffed the vassal 18. Xiang Yu didn't want Liu Bang to be the king of Guanzhong originally, fearing that he would break his word. So he planned with Fan Zeng: "The roads in Ba and Shu are steep, Qin exiles all live in Shu, and Ba and Shu also live in Guanzhong." So Liu Bang was named Hanwang, ruling Ba, Shu, Hanzhong and other places, with Nanzheng (now Hanzhong, Shaanxi) as its capital. And the pass was divided into three, divided into three generals of Qin, in order to block the eastward passage of Hanwang: Zhang Han was the king of Yong, in charge of Xianyang West, and set up the abandoned hill of the capital (now southeast of Xingping, Shaanxi); Sima Xin is the King of Sai, in charge of the east of Xianyang and the west of the Yellow River, with Liyang as the capital (now northeast of Lintong, Shaanxi); Dong Kun was Zhai Wang, in charge of Shang Jun, and set up a capital slave (now northeast of Yan 'an, Shaanxi).