Zhang Xun was born in 709, during the reign of Emperor Zhongzong of Tang. The official histories ''Book of Tang'' and ''New Book of Tang'' disagreed about the location where Zhang's family was from, with the ''Book of Tang'' indicating that the family was from Pu Prefecture and the ''New Book of Tang'' indicating that the family was from Deng Prefecture .
Battle of Suiyang
Yin Ziqi launched repeated attacks on Suiyang, each time repelled by Zhang Xun. Meanwhile, though, the food supplies — which Xu Yuan had initially gathered plenty of in anticipation of a siege but which Li Ju had forced Xu to partially give to two other commanderies, Puyang and Jiyin — began to run out. By summer 757, Suiyang was in desperate straits, with the soldiers forced to eat a mixture of rice, tea leaves, paper, and bark. Many suffered from illnesses. Despite this, Zhang continued to fight off attack after attack. He also divided the defense zones with Xu, with him defending the northeast side and Xu defending the southwest side, both spending the days and nights with the soldiers in defending the city. He often called out to the Yan troops, trying to persuade them that the Tang cause was righteous, and it was said that often, Yan soldiers would be touched by his words and surrender and join his troops.
After Emperor Suzong returned to Chang'an, he posthumously honored a large number of officials who stayed faithful to Tang and died fighting the Yan forces. However, the matter of whether to honor Zhang and Xu became an immediately controversial matter due to the cannibalism that had occurred at Suiyang. A friend of Zhang's, Li Han, wrote a biography of Zhang's in an impassioned defense of Zhang, arguing that without Zhang's actions, Tang would have lost the war entirely. Li Han was joined in his opinion by several other officials, including Li Shu , Dong Nanshi , Zhang Jianfeng , Fan Huang , and Zhu Juchuan . Emperor Suzong accepted their defense of Zhang's, and honored Zhang, Xu, and Nan in particular, as well as the other officers who died in the siege. He also gave their families great rewards. A temple was built at Suiyang to honor Zhang and Xu, known as the Double Temple .