In 202 BCE, peasant-born military commander Liu Bang defeated Xiang Yu of Chu at the Battle of Gaixia, ending the four-year Chu-Han Contention. Han Xin's pincer maneuver encircled Xiang Yu, who broke out with a small contingent and died at the Wu River. At Dingtao, Liu Bang accepted the title of emperor and proclaimed the Han dynasty as Emperor Gaozu. He retained the Qin administrative model — commanderies and standardized law — while granting kingdoms to allies as compromise. Capital was established at Chang'an (modern Xi'an). Han imperial institutions would persist with one brief interruption for over four centuries.