Gang Bing is most notable for his act of self-castration as a display of loyalty to his emperor. He served under the Yongle Emperor, the third emperor of the Ming dynasty who ruled over China from 1402 to 1424. Historical accounts describe Gang Bing as the emperor's favorite general. Because of this, the Yongle Emperor placed Gang Bing in charge of the palace in Beijing while he left for a hunting expedition.
At this point political intrigue within the walls of the Forbidden City forced Gang Bing to make a drastic choice. The Yongle Emperor possessed a large harem of concubines; sexual contact with a concubine by anyone other than the emperor was a severe offense. Fearing that rivals within the palace may accuse him of sexual improprieties with one of the 73 imperial concubines, Gang Bing decided to execute a plan of terrible self-infliction the night before the emperor left for his trip: he severed his own penis and testicles with a knife. The general then placed his severed organs into a bag under the saddle of the emperor’s horse.
As predicted, when the Yongle Emperor returned from his hunt, one of the emperor's ministers reported that Gang Bing had had inappropriate relations within the imperial harem. When accused of misconduct, Gang Bing instructed that the emperor's saddle be retrieved and requested that the emperor reach inside the bag under the saddle. Inside the bag, the emperor found Gang Bing's shriveled, blackened genitalia. Deeply impressed, the Yongle Emperor elevated Gang Bing to the rank of chief eunuch, a politically powerful position within the palace; gave him numerous gifts; and proclaimed him holy.
After Gang Bing's death around 1411, the Yongle Emperor had his general and chief eunuch deified as the Patron Saint of Eunuchs. In addition, the emperor assigned a plot of land on the outskirts of Beijing as a cemetery for eunuchs and built an ancestral hall in Gang Bing's honor. In 1530, the ancestral hall was expanded and renamed The Ancestral Hall of the Exalted Brave and Loyal (Huguo Baozhong Si), but the temple was popularly known as the "Eunuch’s Temple." In the early 20th century, the hall was still in use by eunuchs and the temple grounds contained courts and halls. In 1950, after the Communist take over of China, the Eunuch's Temple was renamed Beijing Municipal Cemetery for Revolutionaries and in 1970 was again renamed Babaoshan National Cemetery for Revolutionaries, the name it bears today.
- Carter Stent, G. (1877). "Chinese Eunuchs". Journal of the North China Branch of the Royal Asiatic Society (11).
- Panati, Charles (1998). Sexy Origins and Intimate Things: The Rites and Rituals of Straights, Gays, Bis, Drags, Trans, Virgins, and Other. New York: Penguin Books. p. 493. ISBN 0140271449.
- Lieberman, Tucker (2004). The Soul and the Sun. Xlibris Corporation. p. 46. ISBN 1-4134-6159-X.
- "View from the Eunuch's Temple". Powerhouse Museum. Retrieved 2006-11-27.
- Pattanaik, Devdutt (2001). The Man Who Was a Woman and Other Queer Tales of Hindu Lore. Haworth Press. p. 13. ISBN 1-56023-181-5.