Li Huaiguang continued to resist Tang forces. By fall 785, however, with Tang forces under Ma Sui and Hun Jian converging on Hezhong, Li Huaiguang committed suicide, and his army resubmitted to Tang. Meanwhile, Li Xilie's continued attempts to expand were being repeatedly rebuffed by Tang generals. In summer 786, with Li Xilie being ill, his general Chen Xianqi had him poisoned, slaughtered his family, and then resubmitted to Tang authority. (While Chen was soon thereafter himself assassinated by Wu Shaocheng, Wu continued to pledge allegiance to Tang.) Nominally, the realm was again entirely under Emperor Dezong's rule. Period of strong chancellors Li Mi and Lu Zhi (early Zhenyuan era) However, by this point, the empire was in deep trouble due to the wars, and Tufan forces, taking advantage of Tang's weakening, were making repeated incursions into Tang territory. Tufan's chancellor Shang Jiezan (), in particular, believed that he would be able to conquer Tang if he could get three Tang generals out of the way—Li Sheng, Ma Sui, and Hun Jian. With Emperor Dezong beginning to become paranoid about generals having too much power by this point, it was soon thereafter that rumors spread by Shang and Li's political enemy Zhang Yanshang, then a chancellor, made Emperor Dezong suspicious of Li Sheng, who was then the military governor of Fengxiang Circuit (鳳翔, in modern Baoji, Shaanxi). In 787, he recalled Li back to Chang'an to serve as chancellor as well, stripping him of his military command. Meanwhile, Shang continued the next stage of his plan, by submitting a peace proposal through Ma. Emperor Dezong believed Shang's good faith and agreed to the treaty, despite Li's warnings. At Shang's request, Emperor Dezong sent Hun to meet with Shang and sign the treaty. On July 8, 787, the day set for the treaty signing, Shang ambushed Hun at the meeting site, intending to capture him, but Hun escaped with emergency aid from Luo Yuanguang and Han Yougui. As Ma was responsible for arranging the peace treaty with Shang, Emperor Dezong recalled him to Chang'an as well and stripped him of his command of Hedong Circuit (河東, in modern Taiyuan, Shanxi). After the disaster, Emperor Dezong recalled Li Mi, who had been serving as the governor (觀察使, Guanchashi) of Shan'guo Circuit (陝虢, headquartered in modern Sanmenxia, Henan), to Chang'an to serve as chancellor, and soon thereafter, Li Mi effectively became sole chancellor.