Lifei's deputy. Subsequently, at Duan's request, Li Siye's casket was sent to Hezhong (河中, in modern Yuncheng, Shanxi), where it was buried in grand ceremony at Duan's expense. This touched Lifei greatly, and he recommended Duan for a promotion in rank. In 762, while a number of armies were at Hezhong, including the Anxi army, Lifei was killed in an army mutiny, along with many other officers, but the soldiers respected Duan and did not dare to harm him. Subsequently, Bai Xiaode () was put in command of the Anxi army, and Duan remained as Bai's deputy. This continued after Bai was made the military governor of Fufang Circuit (鄜坊, headquartered in modern Yan'an, Shaanxi). During Emperor Daizong's reign Also in 762, Emperor Suzong died and was succeeded by his son Emperor Daizong. In 763, when Tufan forces launched a surprise attack against Chang'an and forced Emperor Daizong to flee to Shan Prefecture (陝州, in modern Sanmenxia, Henan), Duan Xiushi persuaded Bai Xiaode to join the forces of the other circuits in aiding the emperor. Subsequently, Bai was made the military governor of Binning Circuit (邠寧, headquartered in modern Xianyang, Shaanxi), and Duan continued to serve as his deputy. At one time, when the circuit lacked food, Bai temporarily moved his army to Fengtian (奉天, also in modern Xianyang). However, Fengtian was then in a state of confusion as the local government had collapsed, and the soldiers, in response, were pillaging the area. Duan requested to serve as discipline officer as well, and subsequently, Duan imposed strict discipline on the army and stopped the pillaging. Upon the army's return to Binning's capital Bin Prefecture, Duan was created the Prince of Zhangye. Later in the year, there was a Tufan incursion, and an army commanded by Guo Ziyi, the deputy supreme commander of the armed forces (in effect, the supreme commander, as Emperor Daizong's son Li Kuo the Crown Prince was the nominal supreme commander) helped to defend Bin Prefecture against Tufan forces. After the Tufan threat subsided, Guo returned to Chang'an, but his forces, under the command of his son Guo Xi (), remained at Bin Prefecture. Guo Xi's soldiers lacked proper discipline and became a major problem for the people of Bin Prefecture, and Bai was troubled but unsure what to do because Guo Xi was Guo Ziyi's son. Duan volunteered to again be discipline officer, and after one