End of the Han dynasty
The end of the Han dynasty refers to the period of Chinese history from 189 to 220 AD, which roughly coincides 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. Eventually, one of those warlords, Cao Cao, was able to gradually reunify the empire, ostensibly under Emperor Xian's rule, but the empire was actually controlled by Cao Cao himself. Cao Cao's efforts to completely reunite the Han empire 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 Emperor Xian's abdication in 220 to the partial reunification of China under the Jin dynasty in 265 was known as the Three Kingdoms era in Chinese history.
Military history of the Three Kingdoms
On 11 December, 220, Cao Pi deposed the last Han emperor and proclaimed himself Emperor of Cao Wei. During his reign Cao Pi alienated his brothers Cao Zhang and Cao Zhi. Cao Pi deeply distrusted his close kin and reduced their powers out of suspicion of their loyalty. Cao Pi died in 226 and was succeeded by his son Cao Rui. Although Cao Rui was twenty years old, he was nonetheless appointed a regency council by his father prior to his death. By 236, three members of the regency council had died, leaving Sima Yi as the primary leader of Cao Wei. Shu Han continued to press the Wei borders and in 233, Zhuge Liang occupied Wudu Commandery. He was checked there by Sima Yi and died the following year. In 238 Sima Yi annexed the Gongsun state in the northwest. This was followed by a campaign into Goguryeo in 244 and 245. Cao Rui died in 239 and was succeeded by his adopted son Cao Fang, who fell under the regency of Cao Shuang and Sima Yi.