In ancient China castration was both a traditional punishment (until the Sui Dynasty) and a means of gaining employment in the Imperial service. At the end of the Ming Dynasty there were 70,000 eunuchs (宦官 huàn’guān, or 太監 tàijiān) in the Imperial palace. The value of such employment—certain eunuchs gained immense power that may have superseded that of the prime ministers—was such that self-castration had to be made illegal. The number of eunuchs in Imperial employ had fallen to 470 in 1912, when their employment ceased. The justification of the employment of eunuchs as high-ranking civil servants was that, since they were incapable of having children, they would not be tempted to seize power and start a dynasty. Concurrently, a similar system existed in Vietnam.
The tension between depraved eunuchs in the service of the emperor and virtuous Confucian officials resisting their tyranny is a familiar theme in Chinese history. In his History of Government, Samuel Finer points out that reality was not always that clear-cut. There were instances of very capable eunuchs, who were valuable advisors to their emperor, and the resistance of the “virtuous” officials often was procrastination on the part of a privileged class which blindly resisted any change, whether it be for the good or the bad of the empire.