prefects were also able to defeat Li Qi's officers, except for Li Su () the prefect of Su Prefecture, who was captured by Li Qi's officer Yao Zhi'an (). On November 14, Emperor Xianzong issued an edict stripping Li Qi of his titles and of his imperial clan membership. He ordered seven circuits around Li Qi's to converge on Zhenhai. Meanwhile, Li Qi was intending to attack and capture Xuan Prefecture (宣州, in modern Xuancheng, Anhui) due to Xuan's prosperity, and he gave 3,000 soldiers to his officers Zhang Ziliang (), Li Fengxian (), and Tian Chaoqing () to have them attack Xuan Prefecture. However, the three of them knew that Li Qi could not stand long, and they conspired with Li Qi's nephew Pei Xingli () to act against Li Qi. The night after they departed Run Prefecture, they informed their soldiers their intentions, and the soldiers followed them back to Run Prefecture and attacked the city. When Li Qi heard that Zhang had turned against him, he initially angrily ordered resistance, but when he heard that Pei joined Zhang as well, he became saddened and found the situation hopeless; instead, he escaped and tried to hide. When one of his officers, Li Jun (), tried to resist with 300 Wanqiang soldiers, Pei defeated and killed Li Jun. Li Qi was captured and delivered to Chang'an. The Wanqiang and Fanluo soldiers, hearing this, all committed suicide. The chancellors initially discussed executing Li Qi's cousins. The official Jiang Ai () pointed out that Li Qi's cousins were all Li Shentong's descendants and should not suffer this kind of fate. When the chancellors discussed alternatively that Li Qi's brothers be executed, Jiang further pointed out how Li Guozhen had died in imperial service, and that his descendants should be allowed to survive. The chancellors agreed and only exiled Li Qi's cousins. On December 3, Li Qi arrived at Chang'an. Emperor Xianzong personally questioned him as to why he rebelled.Li Qi responded, "I did not want to rebel. It was Zhang Ziliang and others like him who told me to rebel." Emperor Xianzong responded, "You are the commander. If Zhang and the others were plotting treason, why did you not execute them and then come to see me?" Li Qi was unable to respond, and he was executed with his son Li Shihui () by being cut in half at the waist.