The Disasters of the Partisan Prohibitions () refers to two incidents in which a number of Confucian scholars who served as officials in the Han imperial government and opposed to powerful eunuchs, and the university students (太學生/弟子員) in the capital Luoyang who supported them (collectively referred to by the eunuchs as "partisans" (黨人, dangren), were imprisoned.  Some were executed; some were released but lost their civil rights.  The first incident (in 166) was largely bloodless, but the second incident (in 169), which came after the Confucian scholars Dou Wu (the father of Empress Dowager Dou) and Chen Fan were defeated by eunuchs in a physical confrontation, saw a large number of the partisans lose their lives.  The restrictions on civil liberties imposed on the surviving partisans were not lifted until 184 when Emperor Ling was concerned that the partisans would join the Yellow Turban Rebellion.

First Disaster of the Partisan Prohibitions
The root of the first Disaster of the Partisan Prohibitions came perhaps in 159, when, with the support of five powerful eunuchs, Emperor Huan was able to overthrow the yoke of the domineering Liang Ji,  the brother of both his former regent Empress Dowager Liang and his wife Empress Liang Nüying, in a coup d'état.  He put the five eunuchs and their associates into powerful positions,   and these eunuchs and their supporters became extremely corrupt.   As a result, a number of Confucian officials who served in the imperial administration began a conscious effort to form a coalition to drive out the influence of the eunuchs.   In the realm of public opinion, they were supported by university students in the capital, who admired them greatly and adored them as heroes against eunuch domination.  For several years, there was somewhat of balance and counterbalance of power at court; at times the officials would successfully accuse the eunuchs of wrongdoing, and those accused eunuchs would lose power; at times the officials would be unsuccessful and instead be driven out of government by the eunuchs.

The matter came to a head in 166 over a murder case.  Zhang Cheng (張成), a fortuneteller in Luoyang, had foretold that a general pardon would be forthcoming, and he therefore instructed his son to commit a murder.   Li Ying, one of the foremost Confucian scholars in government who was serving as the governor of the capital province, arrested the Zhangs, but at this time a general pardon was issued.   Li, in anger, disregarded the pardon and executed the Zhangs anyway.   However, Li did not anticipate that eunuchs friendly to Zhang would then accuse Li and the other officials of encouraging university students to criticize government and the emperor.  Emperor Huan became extremely enraged, and while Chen Fan, who was then the commander of the armed forces, opposed drastic actions, Emperor Huan disregarded his opposition and went ahead and arrested Li and two ministers, Du Mi (杜密) and Chen Xiang (陳翔), as well as some 200 university students.   Emperor Huan also issued an arrest order for other university students—and it was this arrest order that coined the term "the partisans."  Chen Fan continued to protest, and was removed from his post.

The next year (167), Dou Wu submitted a humble petition requesting leniency for the partisans and tendering his resignation.   Another official, Huo Xu (霍謣), also submitted a similar petition.   Further, the eunuchs became concerned that the university students' interrogation logs often mentioned their own younger family members, and therefore also wanted the investigation to end.  Therefore, under their urging, Li, Du, Chen, and the university students were released and exiled back to their original home commanderies.   Their civil liberties were stripped for life.

Restoration of rights under Empress Dowager Dou's regency
Early 168, Emperor Huan died without an heir.   Empress Dou became empress dowager and regent, and her father Dou Wu and Chen Fan became the leading officials at court.   They selected Liu Hong (劉宏), the 12-year-old Marquess of Jieduting, as the new emperor (as Emperor Ling).  Empress Dou continued to serve as regent.  Under the advice of her father and Chen, she restored the rights of the partisans, and in fact made many of them imperial officials.

Later in 168, concerned that the eunuchs were exerting too much influence with the young emperor and the empress dowager, Dou Wu and Chen entered into a plan to exterminate the leading eunuchs.  When word got out, the eunuchs instead incarcerated Empress Dowager Dou to get her seal and mobilized the imperial guards and had Chen arrested and executed. Dou Wu resisted, but was defeated after a short campaign in and near the capital, and he committed suicide.   The eunuchs immediately removed the partisans from government and again suspended their civil liberties.

Second Disaster of the Partisan Prohibitions

The eunuchs were not content with just removing the partisans from government.  In 169, they persuaded the 13-year-old Emperor Ling that the partisans were intent on rebellion.   The leading partisans, including Li, Du, Fan Pang (范滂), were arrested and executed.  Overall, about 100 people lost their lives.  Many partisans hid, with the assistance of an underground network who largely remained anonymous even later, but included such eventually-important figures as Yuan Shao and Kong Rong.  The partisans who were not on the arrest rolls had their liberties further restricted.

End
In 184, after the start of the Yellow Turban Rebellion, one of the eunuchs who sympathized with the partisans, Lü Qiang (呂強), persuaded Emperor Ling that if he did not pardon the partisans, they might join the Yellow Turban Rebellion and inflict great damage on the imperial administration.   Emperor Ling therefore granted the partisans a full pardon and restored their civil liberties.   (As a result, though, Lü himself would become a victim of the wrath of his fellow eunuchs, and he was falsely accused of conspiring to depose the emperor later that year.  He committed suicide.)

References
Rafe De Crespigny's  Emperor Huan and Emperor Ling
Part 2
Part 3
Part 4
Part 6

Notes

Han dynasty
166
169
2nd century in China
Political repression in China
Political party factions in China