Men punished with castration during the Han dynasty were also used as slave labor. In Han dynasty China castration continued to be used as a punishment for various offences. Sima Qian, the famous Chinese historian, was castrated by order of the Han Emperor of China for dissent. In another incident multiple people, including a chief scribe and his underlings, were subjected to castration. Near the end of the Han dynasty in 189, a group of eunuchs known as the Ten Attendants managed to gain considerable power at the imperial court, so that a number of warlords decided they had to be eliminated to restore the emperor's government. However, the loyalist warlord He Jin was lured into a trap inside the palace and killed by the eunuchs. The other warlords led by Yuan Shao then stormed the palace and massacred the Ten Attendants and many other eunuchs. In the wake of the fighting, Dong Zhuo seized power. Indigenous tribals from southern China were used as eunuchs during the Sui and Tang dynasties. The Khitans adopted the practice of using eunuchs from the Chinese and the eunuchs were non-Khitan prisoners of war. When they founded the Liao dynasty they developed a harem system with concubines and wives and adopted eunuchs as part of it. The Khitans captured Chinese eunuchs at the Jin court when they invaded the Later Jin. Another source was during their war with the Song dynasty, the Khitan would raid China, capture Han Chinese boys as prisoners of war and emasculate them to become eunuchs. The emasculation of captured Chinese boys guaranteed a continuous supply of eunuchs to serve in the Liao Dynasty harem. The Empress Dowager Chengtian played a large role in the raids to capture and emasculate the boys. She personally led her own army defeated the Song in 986, fighting the retreating Chinese army. She then ordered the castration of around 100 Chinese boys she had captured, supplementing the Khitan's supply of eunuchs to serve at her court, among them was Wang Ji'en. The boys were all under ten years old and were selected for their good looks. As with all parts of the Mongol Empire, Goryeo provided eunuchs to the Mongols. One of them was Bak Bulhwa, who caused harm to Goryeo. There were eunuchs from China's various ethnic tribes, Mongolia, Korea, Vietnam, Cambodia, Central Asia, Thailand, and Okinawa.