[3][5][6] However, Wei Gao the military governor of Xichuan Circuit (西川, headquartered in modern Chengdu, Sichuan) heard about him and invited him to serve on staff.
[5][7] While the future chancellor Li Jifu was serving as the prefect of Zhong Prefecture (忠州, in modern Chongqing), a part of Xichuan Circuit, he and Duan had correspondences.
Gao treated them with respect and released them, recommending several of them for promotions, but stated to Duan, "You, sir, will one day be a major general or chancellor.
He was soon thereafter made an imperial censor with the title Jiancha Yushi (監察御史), then Zuo Bujue (左補闕), a consultant at the examination bureau of government (門下省, Menxia Sheng).
[10] In spring 821, it was said that then-military governor of Xichuan, Wang Bo, was making many attempts in official circles to become chancellor, including bribing the powerful eunuchs.
Shortly thereafter, Duan also offered to resign, and he was made the military governor of Xichuan, while Wang was kept at the capital Chang'an to serve as the minister of justice and director of salt and iron monopolies.
[3] Shortly after Duan was sent to Xichuan, a major scandal broke over high-level officials' influence over the imperial examination results that year.
Both Duan and the imperial scholar Li Shen had submitted a list of examinees that they hoped would be passed to Qian Hui (錢徽), one of the officials in charge of the examinations that season, but once the results were published, the examinees that Duan and Li Shen recommended did not pass, while those who passed included the several relatives of other officials—Zheng Tan's brother Zheng Lang; Pei Du's son Pei Zhuan (裴譔); Li Zongmin's son-in-law Su Chao (蘇巢); and Yang Yinshi (楊殷士), brother to the other official in charge of the examinations that year, Yang Rushi (楊汝士).
Emperor Muzong thus ordered a reexamination, while demoting Qian, Li Zongmin, and Yang Rushi, along with 10 examinees who passed based on perceived influence.
Soon thereafter, he was made the military governor of Huainan Circuit (淮南, headquartered in modern Yangzhou, Jiangsu), carrying an honorary chancellor title of Tong Zhongshu Menxia Pingzhangshi.