"Castration", in China, meant the severing of the penis in addition to the testicles, after which male offenders were sentenced to work in the palace as eunuchs.The punishment was called "gōngxíng" (宫刑), which meant "palace punishment", since castrated men would be enslaved to work in the harem of the palace.