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. During this period, 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. One of those warlords, Cao Cao, was gradually reunifying the empire, ostensibly under Emperor Xian's rule; the Emperor and his court were actually controlled by Cao Cao himself, who was opposed by other warlords. Cao Cao's efforts to completely reunite the land 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. A year later, in response to Cao Pi's usurpation of the Han throne, Liu Bei declared himself emperor of Shu Han; and in 229, Sun Quan followed suit, declaring himself emperor of Eastern Wu. The period from the fall of the Han dynasty in 220 to the partial reunification of China under the Jin dynasty in February 266 is known as the Three Kingdoms era in Chinese history. Collapse of imperial authority (184–191) Yellow Turban Rebellion and decentralisation (184–189) Towards the end of the reign of Emperor Ling of Han (r. 168–189), many officials in the imperial court foresaw chaos in the political scene as soon as Emperor Ling died. One of those officials, Liu Yan, suggested to Emperor Ling in 188 that the root of the agrarian revolts during that time, including the most serious one, the Yellow Turban Rebellion of 184, was that Inspectors (刺史) lacked substantial administrative powers. Emperor Ling, convinced by Liu Yan, changed the Inspectors' titles to "Governor" (牧) and granted them the authority to levy taxes and command armed forces within the borders. Liu Yan was commissioned as the Governor of Yi Province (covering the Sichuan Basin), while several other important officials also became Governors, including Liu Yu, who was appointed Governor of You Province (covering present-day northern Hebei, Beijing, Tianjin and