Liu Bang (256 – 195 BC), styled Han Gaozu, was the founder and first ruler of the Han dynasty.
After Qin Shi Huang's death, there were revolts everywhere against his incompetent son and successor Xi Shi Huang. One of these rebellions started in 209 BC, under Liu Bang. After one of the first rebel generals, Chen Sheng, was killed by one of his guards, Liu Bang became leader of his force. To rally the disparate forces against Qin, Liu Bang reinstated the Chu monarchy and installed a member of the deposed Chu royalty, Mi Xin, as the Prince of Chu.
War with Xiang Yu
In 207 BC, Liu Bang prepared an invasion of the Qin proper. He was unaware that Xiang Yu had already moved deep into Qin territory and was near its capital. When Liu Bang arrived at Hangu Pass, he found it guarded by Xiang Yu's forces. He seized the pass, then approached Xiang Yu's encampment. Enraged, Xiang Yu killed Liu Bang's favored advisor and burned the Qin palace. This started the war known as the Chu-Han Contention.
Although Xiang Yu won most of his battles against Liu Bang, the people supported Liu Bang. Xiang Yu kept defeating Liu Bang in the battlefield, but each victory drove more people away. When Xiang Yu was finally defeated in the Battle of Gaixia, he committed suicide. Having defeated Xiang Yu, Liu Bang proclaimed himself emperor and established the Han Dynasty in 202 BC, making Chang'an his capital.
After Liu Bang came into power, he re-modeled China based on the Qín example. He reduced taxes, developed agriculture and restricted spending. In response to what he saw as the decadence of Qin merchants, he restricted commerce using legal restrictions on merchants. He also made peace with the Xiongnu. Confucian scholars were welcomed into his government, while the harsh Legalist laws were lessened.