During Emperor Daizong's Reign
After Emperor Suzong died in 762 and was succeeded by his son Emperor Daizong, the chancellor Yuan Zai became a dominant figure at court. As Yuan had been recommended by Miao Jinqing, he treated Zhang Yanshang, as Miao's son-in-law, with kindness. When Emperor Daizong was forced to flee to Shan Prefecture (陝州, in modern Sanmenxia, Henan) in 763, at Yuan's recommendation, Emperor Daizong made Zhang an imperial attendant (給事中, Geishizhong). Soon thereafter, he became deputy chief imperial censor (御史中丞, Yushi Zhongcheng) and Zhongshu Sheren (中書舍人), a mid-level official at the legislative bureau of government (中書省, Zhongshu Sheng).
In 767, Zhang was made the mayor of Henan Municipality (河南, i.e., the region of the eastern capital Luoyang). During the Anshi Rebellion, Luoyang suffered greatly from the wars, and much of it was in ruins. It was said that Zhang was diligent and hardworking, and he ruled simply. He also reopened the canals and rebuilt the palaces and imperial temples. Within several years, refugees returned, and Luoyang returned to prosperity. Emperor Daizong thus praised him in an edict. In 770, when the office of deputy supreme commander of the Henan, Huaixi (淮西, headquartered in modern Zhumadian, Henan), and Shannan (i.e., the region south of the Qinling Mountains) Regions was abolished, the troops formerly attached to that office were transferred to Zhang. Subsequently, Zhang was recalled to Chang'an to serve as chief imperial censor (御史大夫, Yushi Daifu). While he was serving in that role, there was an occasion when the junior official Li Shaoliang (李少良) submitted a number of accusations against Yuan, and Yuan's associates in turn accused Li of false accusations and had him arrested and detained at the office of the imperial censors. Zhang disapproved of the action and did not want to be involved, and he was sent to Huainan Circuit (淮南, headquartered in modern Yangzhou, Jiangsu) to serve as its military governor as well as the prefect of its capital Yang Prefecture (揚州). At that time, there was a drought in the circuit, and a large number of the people were trying to depart for other regions. Zhang's subordinates detained them, but Zhang, pointing out that the people should be given the opportunity to survive the drought, allowed them to leave and, in their absence, kept their houses maintained and exempted them from taxes. As a result, many returned thereafter. He later left governmental service when his mother died, to observe a period of mourning for her. After the mourning period was over, he was recalled to serve as the military governor of Jingnan Circuit (荊南, headquartered in modern Jingzhou, Hubei), as well as the mayor of its capital, Jiangling Municipality.
Read more about this topic: Zhang Yanshang