section_path: History/End of the Han dynasty
section_name: End of the Han dynasty
paragraph_text: End of the Han dynasty
  
  The Partisan Prohibitions were repealed during the Yellow Turban Rebellion and Five Pecks of Rice Rebellion in 184 AD, largely because the court did not want to continue to alienate a significant portion of the gentry class who might otherwise join the rebellions. The Yellow Turbans and Five-Pecks-of-Rice adherents belonged to two different hierarchical Taoist religious societies led by faith healers Zhang Jue (d. 184 AD) and Zhang Lu (d. 216 AD), respectively.
  
  Zhang Lu's rebellion, in what is now northern Sichuan and southern Shaanxi, was not quelled until 215 AD. Zhang Jue's massive rebellion across eight provinces was annihilated by Han forces within a year; however, the following decades saw much smaller recurrent uprisings. Although the Yellow Turbans were defeated, many generals appointed during the crisis never disbanded their assembled militias and used these troops to amass power outside of the collapsing imperial authority.
  
  General-in-chief He Jin (d. 189 AD), half-brother to Empress He (d. 189 AD), plotted with Yuan Shao (d. 202 AD) to overthrow the eunuchs by having several generals march to the outskirts of the capital. There, in a written petition to Empress He, they demanded the eunuchs' execution. After a period of hesitation, Empress He consented. When the eunuchs discovered this, however, they had her brother He Miao (何苗) rescind the order. The eunuchs assassinated He Jin on 22 September 189.
  
  Yuan Shao then besieged Luoyang's Northern Palace while his brother Yuan Shu (d. 199 AD) besieged the Southern Palace. On September 25 both palaces were breached and approximately two thousand eunuchs were killed. Zhang Rang had previously fled with Emperor Shao (r. 189 AD) and his brother Liu Xie—the future Emperor Xian of Han (r. 189–220 AD). While being pursued by the Yuan brothers, Zhang committed suicide by jumping into the Yellow River.
  
  General Dong Zhuo (d. 192 AD) found the young emperor and his brother wandering in the countryside. He escorted them safely back to the capital and was made Minister of Works, taking control of Luoyang and forcing Yuan Shao to flee. After Dong Zhuo demoted Emperor Shao and promoted his brother Liu Xie as Emperor Xian, Yuan Shao led a coalition of former officials and officers against Dong, who burned Luoyang to the ground and resettled the court at Chang'an in May 191 AD. Dong Zhuo later poisoned Emperor Shao.
  
  Dong was killed by his adopted son Lü Bu (d. 198 AD) in a plot hatched by Wang Yun (d. 192 AD). Emperor Xian fled from Chang'an in 195 AD to the ruins of Luoyang. Xian was persuaded by Cao Cao (155–220 AD), then Governor of Yan Province in modern western Shandong and eastern Henan, to move the capital to Xuchang in 196 AD.
  
  Yuan Shao challenged Cao Cao for control over the emperor. Yuan's power was greatly diminished after Cao defeated him at the Battle of Guandu in 200 AD. After Yuan died, Cao killed Yuan Shao's son Yuan Tan (173–205 AD), who had fought with his brothers over the family inheritance. His brothers Yuan Shang and Yuan Xi were killed in 207 AD by Gongsun Kang (d. 221 AD), who sent their heads to Cao Cao.
  
  After Cao's defeat at the naval Battle of Red Cliffs in 208 AD, China was divided into three spheres of influence, with Cao Cao dominating the north, Sun Quan (182–252 AD) dominating the south, and Liu Bei (161–223 AD) dominating the west. Cao Cao died in March 220 AD. By December his son Cao Pi (187–226 AD) had Emperor Xian relinquish the throne to him and is known posthumously as Emperor Wen of Wei. This formally ended the Han dynasty and initiated an age of conflict between the Three Kingdoms: Cao Wei, Eastern Wu, and Shu Han.