Eunuchs were used as servicemen in the inner parts of the imperial and the princely palaces already in pre-imperial times. During the Eastern Han 東漢 (25-220 CE), the later Tang 唐 (618-907), and the Ming 明 (1368-1644) periods some eunuchs gained considerable power and influenced the fate of the dynasties.
They were mainly recruited from poor families. Some fathers had even their own sons mutilated to give them a chance for employment. Eunuchs were state employees serving not only in the women's quarters, but all over the palace in a wide range of duties, from the lowest positions up to the administration of the imperial household. The terms used for eunuchs varied over time: siren 寺人, yanren 閹人, yanren 奄人, yanhuan 閹宦, huanzhe 宦者, zhongguan 中官, neiguan 內官, neichen 內臣, neishi 內侍 or neijian 內監, yet the most common was huanguan 宦官, and, when serving in a higher office during the Ming and Qing 清 (1644-1911) periods, taijian 太監 "grand supervisors". Normally eunuchs had no chance to get involved in politics, but some of them actively sought access to power. At the heyday of eunuch power during the late Ming period, there were as much as 100,000 eunuchs in service.
The institution of eunuchs is first described in the ritual Classic Zhouli 周禮. Eunuchs during the Zhou period 周 (11th cent.-221 BCE) served as palace gate keepers, transmitted documents, and served the emperor. The first eunuchs whose names are known, were Qi Shuxi 齊豎習 and Song Yili 宋伊戾. The first eunuch who influenced the fate of a dynasty was Zhao Gao 趙高 (258-207 BCE), who usurped power after the death of the First Emperor of Qin 秦始皇帝 (r. 246-210 BCE). During the Later Han period, eunuchs served as advisors of empresses dowager acting as regents for under-age emperors. Such eunuchs were Hou Lan 侯覽 (d. 172 CE) and Cao Jie 曹節 (d. 181 CE). They fought bitterly against the influence of the empresses' kinsmen (waiqi 外戚). The second half of the Tang period saw the influence of eunuchs, too. Li Fuguo 李輔國 (704-762) enthroned Emperor Suzong 唐肅宗 (r. 756-762), and in the ninth century, there was not one emperor whose power or end did not depend from the machinations of eunuchs. Eunuchs were able to dominate even military positions like Minister of War (bingbu shangshu 兵部尚書) or military commissioner (jiedushi 節度使). Yet most notorious was a handful of eunuchs that gained the emperor's favour during the Ming period. They took control over the court administration, provincial government and even the military institutions, and cruelly fought against their opponents in the officialdom. Some of them exerted power with the help of the so-called Brocade Guards (jinyiwei 錦衣衛, see changwei 廠衛), which spied out and terrorized opponents among the officialdom. Although the founder of the Ming, Emperor Taizu 明太祖 (r. 1368-1398), had issued a decree that eunuchs should never interfere into political matters, he left the administration of the imperial household to eunuchs, the superiors of which wielded considerable authority. These were the Twelve Directorates, the Four Offices, and the Eight Services.
The Twelve Directorates (shi'er jian 十二監) were the Directorate of Palace Eunuchs (neiguanjian 内官監), for Palace Accoutrements (yuyongjian 御用監), for Imperial Regalia (sishejian 司設監), of the Imperial Horses (yumajian 御馬監), for Imperial Temples (shengongjian 神宮監), for Palace Delicacies (shangshanjian 尚膳監), of Palace Seals (shangbaojian 尚寶監), for Credentials (yinshoujian 印綬監), for Palace Maintenance (zhidianjian 直殿監), for Imperial Apparel (shangyijian 尚衣監), for Intimate Attendance (duzhijian 都知監), and of Ceremonial (silijian 司禮監). Apart from these institutions, the eunuch apparatus also controlled the *palace supply office (neifu gongyong ku 內府供用庫), the *treasury (siyaoku 司鑰庫), the *palace storehouse (neicheng yunku 內承運庫), the imperial dispensary (yuyaofang 御藥房), the *tea office (yuchafang 御茶房), the *animals office (shengkoufang 牲口房), and the palace secretariat (wenshufang 文書房). Each of the twelve directorates was administered by a eunuch Director (taijian 太監) and two vice directors (shaojian 少監), as well as a staff of scribes.
The Four Offices (sisi 四司) included the firewood office (xixinsi 惜薪司), the bells-and-drums office (zhonggu si 鐘鼓司), the paper office (baochaosi 寶鈔司), and the bathing office (huntangsi 混堂司). Each was headed by a director (zhengsi 司正) and two vice directors.
The Eight Services (baju 八局) included the palace armory (bingzhangju 兵杖局), the caps and kerchief service (jinmaoju 巾帽局), the sewing service (zhengongju 針工局), the palace weaving and dyeing service (nei ranzhi ju 內染織局), the condiments service (jiukumian ju 酒醋麵局), the garden service (siyuanju 司苑局), the palace laundry service (huanyiju 浣衣局), and the jewelry service (yinzuochu 銀作局). Each of these was headed by a eunuch commissioner-in-chief (dashi 大使) and two vice commissioners.
All these institutions were called together the twenty-four offices (ershisi yamen 二十四衙門). The eunuchs thus controlled the complete palace life. The heart of this mechanism was the Directorate for Ceremonial (silijian taijian 司禮監太監), whose head was therefore the key person of the whole eunuch staff, and he had a position similar to that of the Counsellor-in-chief (chengxiang 丞相). Next to him was the head of the Eastern Depot (dongchang 東廠, see changwei), and then the "wielder of the brush" (bingbi 秉筆), who had the right to comment on incoming memorials. The supply system of the imperial household reached far into the southeastern provinces, and for this reason, eunuchs were often sent out to supervise the institutions there, including manufactories, mines, shipyards, granaries, and military garrisons for the protection of these institutions.
Emperor Taizu of the Ming initially forbade the eunuchs to establish relationships with the civilian or military administration of the Outer Court, and new eunuch was allowed to be appointed to an office higher than rank 4. There was even an iron plate above the palace gates reminding the eunuchs that whoever dared to interfere into politics, would be executed. There were in fact only rare occasions in which eunuchs took over duties outside the Inner Court. Yet Emperor Chengzu 明成祖 (r. 1402-1424), who usurped the throne of his nephew, relied for his legitimation to substantial part on the support of court eunuchs, and they took over many duties outside the court, like inspections, purchase actions, or army supply. Wang An 王安 (entered service 1592), for instance, was a military supervisor (du junying 督軍營), and Ma Jing 馬靖 inspecting censor (xunshi 巡視) of the province of Gansu. Emperor Chengzu even entrusted eunuchs with important diplomatic missions. Li Xing 李興 was sent to Xuanluo 暹羅 (modern Thailand), Hou Xian 侯顯 (1403) to the Western Territories (Xiyu 西域), and – most famous – Zheng He 鄭和 (1371-1433) several times to Southeast Asia, India, and East Africa. In 1420 the emperor created the Eastern Depot that was, in addition to the Brocade Guards, a further eunuch institution that had the right to spy out and try state officials.
The first chief eunuch dominating an emperor was Wang Zhen 王振 (d. 1449), who had all his opponents wiped out. He stood under the protection of Emperor Yingzong 明英宗 (r. 1435-1449 and 1457-1464), a young and weak ruler who was totally dependent of the eunuch. Wang Zhen was given the post of Director of Ceremonials. He was so influential that he was was called "Sir" (xiansheng 先生) by the Emperor, and "grandfather" (wengfu 翁父) by the princes and noblemen. In 1449 he sent out the emperor to a hunting expedition, and took this chance to become factual regent. Wang took away the ancient iron plaque inscribed with the ban on the eunuchs' interference into politics. With the help of the Eastern Depot Wang had anyone arrested who had criticized and opposed him, and quite a few officials were sent into exile. The supporting him were highly rewarded. The eunuch's power came only to an end when he persuaded the young emperor to launch a military campaign against Esen (1407-1455), khan of the Mongols. The campaign was not well prepared, and in the camp at Tumu 土木 the Emperor was captured by the Mongols (the Tumu incident, Tumu zhi bian 土木之變). Wang Zhen, responsible for the disaster, died, yet when Yingzong won the throne again in 1457, Wang's old supporters like Cao Jixiang 曹吉祥 (d. 1461) regained high positions at the court. Cao, Director of Ceremonials, was even given the command over the Capital Training Divisions (san da ying 三大營). In 1461 he was executed with the accusation of high treason. They were also given the supervision of the Eastern Depot in the palace, and so obtained the right of investigation and jurisdiction.
Emperor Xuanzong 明宣宗 (r. 1426-1435) founded the eunuch school (neishutang 內書堂), where eunuchs were instructed in handling official documents. This was a deviation from the ancient principle that eunuchs were forbidden to learn reading and writing.
During the reign of Emperor Xianzong 明宣宗 (r. 1426-1435), in 1477, Wang Zhi 汪直 (d. 1487) was made head of the newly founded Western Depot (xichang 西廠). This institution was even more powerful than the Eastern Depot, and Wang Zhi was in highest control of all court affairs, and even threatened officials in the provinces and rich merchants. Those supporting him were promoted, and his critics dismissed or thrown into jail. He inspected troops and was so powerful that even the Censor-in-chief (duyushi 都御史) knelt down in his presence. In these years, the heart of the empire was the Western Depot, and not the throne of the emperor. More than four years long Wang Zhi was the factual regent of the Ming empire.
Yet more powerful was Liu Jin 劉瑾 (1451-1510), Director of Ceremonials and commander of the Integrated Division (tuanying 團營) under Emperor Wuzong 明武宗 (r. 1505-1521). Liu was supported by a group of eight eunuchs called the "Eight Tigers" (ba hu 八虎). They managed to deviate the whole system of official communication, so all memorials to the throne were first to be presented to Liu Jin, handled, and marked with notes in red ink (therefore called hongben 紅本), a privilege normally reserved to the emperor, before being submitted to the Office of Transmission (tongzhengsi 通政司), in the shape of "white files" (baiben 白本). Seven years long Liu Jin was in fact regent of the empire and had control over each administrative unit in the central government. He ruled with terror through the Depot agencies, an particularly founded his own office of scrutiny, the Palast Depot (neihangchang 內行廠), which effected the dismissal and execution of officials of the so-called "conspiratory faction" (jiandang 奸黨). Another group of officials, the so-called "eunuch faction" (yandang 閹黨) supported him from the side of the court. Among these collaborators were Jiao Fang 焦芳 (1435-1517) and Zhang Cai 張綵 (d. 1510?). Liu Jin also extoriated funds from the provincial administration commissioners, and boundlessly enriched himself and his supporters. In 1510, when the suppression of a princely rebellion was finished, the Censor Yang Yiqing 楊一清 (1454-1530) succeeded in winning the emperor's ear. Liu was accused of high treason, and executed.
Under Emperor Shenzong 明神宗 (r. 1572-1619), Director of Ceremonials Feng Bao 馮保 (1543-1583) was a considerably influential position.
Yet the last and most notorious eunuch tyrant was Wei Zhongxian 魏忠賢, who was granted by Emperor Xizong 明熹宗 (r. 1620-1627) the title of Director of Ceremonials wielding the brush (silijian bingbi taijian 司禮監秉筆太監). He had built a living shrine for himself, a right not even reserved for an emperor, and was called "nine thousand years [may he live]" (jiuqian sui 九千歲), which put him just next to the emperor, whom to hail with a wish of "ten thousand years" was appropriate. He was supported by a group of court officials of a eunuch faction (yandang) known in historiography as the "Five Tigers" (wu hu 五虎), "Five Panthers" (wu bao 五彪), "Ten Dogs" (shi gou 十狗), and so on. They helped him to attack his adversaries. This time, a strong opposition formed, called the Donglin Faction (Donglin dang 東林黨). Its members were recorded in the eunuchs' blacklist, called Tianjianlu 天鑒錄. In 1625 Wei Zhongxian carried out a purge among the court officials and had arrested, tortured and killed quite a few members of the Donglin Faction, like Yang Lian 楊漣 (1572-1625) and Gao Panglong 高攀龍 (1562-1626). The turmoils at the court and the uncertainties in the emperor's sovereignty were quite probably an important factor in the decay of the Ming dynasty, yet not the most important one. Emperor Sizong 明思宗 (r. 1627-1644) tried his best to wipe out all traces of the disastrous eunuch domination by proclaiming the categories of treason (ni'an liu deng 逆案六等) and tried more than 300 collaborators tried. Yet even under his reign, eunuchs like Gao Qiqian 高起潛 (died after 1644) and Cao Huachun 曹化淳 (1589-1662年) retained great influence.
The raise of these eunuchs had only been possible because they had gained the favour of the emperor. The mistrust of Emperor Taizu towards the officialdom in general was thus intensified in the long run, and the ceremonial distance between the ruler and his advisors increased. Wei Zhongxian had been a servant of the emperor's foster-mother. The privileges granted to these minions surpassed that of any state official. The chief eunuchs had the right to note down remarks in red colour (pihong 批紅) on the incoming memorials, even before the emperor had seen them. The position of Liu Jin and Wei Zhongxian was thus higher than that of any member of the imperial secretariat (neige 内閣).
They supervised the Eastern Depot, the Integrated Division (i.e. the capital guard), the inner section of infantry (neicao 內操), and managed the state prison. They had the same right as the three Judicial Offices (sanfasi 三法司, i.e. the Censorate, the Ministry of Justice (xingbu 刑部), and the Court of Judicial Review (dalisi 大理寺) to arrest and interview suspects and culprits, to inspect troops and garrisons, and to investigate the management of local offices throughout the empire. These privileges invigorated the power of the sovereign that was, during the Ming period, quite authoritarian anyway. The position of court officials and ministers was critically trimmed. Most of the powerful eunuchs were able to distract the attention of weak rulers from the realm of politics to that of private entertainment. How much the eunuchs' influence depended on the emperor's favour came to light when Emperor Sizong acceded to the throne: He made an immediate end to the machinations of Wei Zhongxian and had him executed. Investigations in the aftermath showed that the eunuch tyrants and their supporters had not just wielded a bloody regime, but also drastically enriched themselves, by extortion, corruption and embezzlement of state-owned and private land.
The Qing dynasty, a warrior-dynasty per definition, learned from the paradigm of the Ming, and strictly controlled the eunuch staff in the imperial city. Military matters were exclusively handled by members of the ruling elite, the Manchus, and memorials handled by princes or members of the Council of State (junjichu 軍機處).
The power of the eunuchs is also reflected in the official history books, like ch. 207-208 (Huanzhe zhuan 宦者傳) of the Xintangshu 新唐書, ch. 304-305 (Huanguan zhuan 宦官傳) in the Mingshi 明史 and ch. 29, 37, 43 and 71 in the Mingshi jishi benmo 明史紀事本末.