The Qin dynasty ruled in China from 221 BC to 206 BC. It was created by the warlord Qin Shi Huang during the Warring States Period and defeated several other states in the area to unite China. While the Qin ruled China for only a very short time, they built both the Terracotta Army and parts of the Great Wall of China. The second, and final emperor, Qin Er Shi, was overthrown by a popular rebellion after the first Qin emperor died. It was followed by the Han hynasty. The Han dynasty was founded by Liu Bang in 202 BC.