Lei Yungong

Lei Yungong (died 23 July 1022) was a Song dynasty palace eunuch who rose to power after foiling fellow eunuch Zhou Huaizheng's coup. He dominated court politics following Emperor Zhenzong's death, by associating with the powerful grand councilor Ding Wei. However, just a few months later he was beaten to death for illegally moving Emperor Zhenzong's burial site to acquire treasures.

During Emperor Zhenzong's reign
Lei Yungong was a native of Kaifeng, the Song dynasty capital. Described as a clever and cunning eunuch, he quickly rose among the ranks of the Palace Domestic Service.

The emperor Zhao Heng (posthumously known as Emperor Zhenzong) was a devout follower of Taoism in his later life. In May 1019, he sent Lei Yungong to the sacred Mount Mao in Jiangning Prefecture to cast his "jade tablet with a golden dragon". During the religious ceremony, seven cranes circled above the altar—or so reported Ding Wei, the prefect of Jiangning, to the emperor, who was very much pleased.

On August 12, 1020, Ding Wei was named grand councilor of the state. Eunuch and Palace Courier Zhou Huaizheng plotted to assassinate him, but failed and was executed on August 16, 1020. Lei was one of the eunuchs who exposed Zhou's forgery of the "Heavenly Text".

Lei had been serving Zhao Zhen, the young heir apparent. In May 1021, he was made director of Zhao Zhen's residential palace in charge of his household, as well as supervisor of the school for imperial princes. In November 1021, he was further promoted, along with his subordinate Liu Congyuan (劉從愿), to become Palace Courier (內殿承制), the same position Zhou Huaizheng held before his death. Lei then lied to Liu Congyuan about the edict, claiming all it stated was to honor his aunt—and thus monopolized power in the imperial palace. Whenever a summon asked for a stored item, Lei would simply provide it without any documentation.

During Emperor Renzong's reign
Zhao Heng died in March 1022 and was succeeded by 11-year-old Zhao Zhen (posthumously known as Emperor Renzong).