唐明宗
As of 926, Kong Xun was serving as the acting prefect of Bian Prefecture, when Emperor Zhuangzong was facing multiple rebellions against him due to the resentment of the people and his own generals. One of the chief rebels was Emperor Zhuangzong's adoptive brother Li Siyuan, who had rebelled at Yedu (鄴都, in modern Handan, Hebei) (under duress by his own subordinates, according to traditional sources). Li Siyuan was advancing south from Yedu toward Bian Prefecture, while Emperor Zhuangzong was trying to head from the capital Luoyang to Bian Prefecture to cut off Li Siyuan's advance. Kong decided to play both sides, so he sent emissaries to both Emperor Zhuangzong and Li Siyuan welcoming them, while secretly informing his subordinates, "Whoever gets here first will get to enter." Li Siyuan arrived at Bian Prefecture first, so he welcomed Li Siyuan into the city. When Emperor Zhuangzong realized this, he returned to Luoyang, where he was then killed in a mutiny headed by the officer Guo Congqian (). Li Siyuan subsequently entered Luoyang and was initially declared regent (while Li Siyuan was still pondering whether to take the throne himself or to offer the throne to Emperor Zhuangzong's son Li Jiji, who was then returning from the campaign in which Later Tang forces conquered Former Shu). Under the recommendation of Li Siyuan's ally Li Shaozhen, Li Siyuan made Kong Xun his chief of staff ("Shumishi") when the carryover chief of staff Zhang Juhan requested retirement. Shortly after, when Li Jiji's own officers turned against him, Li Jiji committed suicide, so Li Siyuan prepared to take the throne. Li Shaozhen and Kong advocated that he end the use of the Tang dynastic name, but under the advice of the official Li Qi, Li Siyuan decided to retain the Tang dynastic name, taking the throne in the role of Emperor Zhuangzong's heir (as Emperor Mingzong).