Pei County
In the Qin dynasty the area was governed as the Hanzhong Commandery, whose seat was in current day Nanzheng County, south of the Hanzhong urban area. In 207 BC, the Qin dynasty collapsed. Liu Bang, who would later become the founding emperor of the Han dynasty, was made lord of Hanzhong. He spent several years there before raising an army to challenge his archrival, Xiang Yu, during the Chu–Han Contention. In 206 BC, after the victory at Gaixia, Liu Bang named his imperial dynasty after his native district, as was customary. However, he chose Hanzhong rather than his birthplace Pei County (present-day Xuzhou, Jiangsu Province). Thus, Hanzhong gave its name to the Han dynasty.