structural:expansion
The end of the Han dynasty was the period of Chinese history from 189 to 220 CE, roughly coinciding with the tumultuous reign of the Han dynasty's last ruler, Emperor Xian. It was followed by the Three Kingdoms era. During the end of the Han dynasty, the country was thrown into turmoil by the Yellow Turban Rebellion (184–205). Meanwhile, the Han Empire's institutions were destroyed by the warlord Dong Zhuo and fractured into regional regimes ruled by various warlords, some of whom were nobles and officials of the Han imperial court. The warlord Cao Cao took control of Emperor Xian and his court in 196 and began gradually reunifying the empire. Cao Cao ostensibly operated under Emperor Xian's rule, though in reality the emperor was a hostage. Cao Cao's efforts to reunify China were rebuffed at the Battle of Red Cliffs in 208-209, when his armies were defeated by the allied forces of Sun Quan and Liu Bei. The Han dynasty formally ended in 220 when Cao Cao's son and heir, Cao Pi, pressured Emperor Xian into abdicating in his favour. Cao Pi became the emperor of a new state, Cao Wei. In response, Liu Bei declared himself emperor of Shu Han in 221 and Sun Quan declared himself emperor of Eastern Wu in 229. The period from the end of the Han dynasty in 220 to the reunification of China under the Jin dynasty in May 280 is known as the Three Kingdoms era in Chinese history.