make a surprise attack, and so Duan Ye merely defended, and Lü Shao and Lü Zuan were forced to withdraw. In summer 400, Lü Zuan, who had by that point become Later Liang's emperor, made a major attack against Northern Liang, putting Zhangye under siege. However, Southern Liang's general Tufa Rutan then made a major attack on Guzang, forcing Lü Zuan to withdraw. Also in 400, Duan would lose a major part of his territory. When his governor of Dunhuang Commandery, Meng Min () died that year, the officials in Dunhuang Commandery supported Li Gao, a county magistrate, as his successor. Duan Ye initially agreed, but was then warned by his general Suo Si () that Li Gao had greater ambitions and should not be permitted to stay at Dunhuang. Duan Ye therefore sent Suo to be the governor of Dunhuang. Li Gao made a surprise attack against Suo and defeated him, and then demanded that Suo be executed. At the advice of Juqu Nancheng (who also disliked Suo), Duan Ye executed Suo and apologized to Li Gao, who briefly remained submissive. However, late in 400, Li Gao, along with Tang Yao (), seceded with six commanderies, establishing Western Liáng, and Li Gao soon took over modern western Gansu and eastern Xinjiang. In 401, Duan Ye, apprehensive of Juqu Mengxun's military abilities, demoted him and replaced him with Ma Quan (), but soon believed Juqu Mengxun's false accusations against Ma and executed him. Juqu Mengxun then proposed to Juqu Nancheng that Duan Ye be killed and replaced with Juqu Nancheng—citing Duan Ye's lack of judgment and ability to govern and that with Suo and Ma dead, there would be no one to oppose them if they made a move against Duan Ye. Juqu Nancheng refused, stating that such an action would be unjust. Juqu Mengxun then set a trap for both Juqu Nancheng and Duan Ye. He set a date with Juqu Nancheng to offer sacrifices to the god of Lanmen Mountain (蘭門山, near Zhangye) on a vacation day, but submitting a false report through the official Xu Xian () that Juqu Nancheng was set to rebel and would start the rebellion on a day that he requested permission to sacrifice to the god of Lanmen Mountain. When Juqu Nancheng requested Duan Ye for such permission, Duan Ye arrested him and ordered him to commit suicide. Juqu Nancheng, who had