Zhang Xun (simplified Chinese: 张巡; traditional Chinese: 張巡; pinyin: Zhāng Xún) (709 – November 24, 757) was a general of the Chinese Tang Dynasty. He was known for defending Yongqiu and Suiyang during the An Shi Rebellion against the rebel armies of Yan, and thus, his supporters asserted, he blocked Yan forces from attacking and capturing the fertile Tang territory south of the Huai River. However, he was severely criticized by some contemporaries and some later historians as lacking humanity due to his encouragement of cannibalism during the Battle of Suiyang. Other historians praised him for his great faithfulness to Tang.
Zhang Xun was born in 709, during the reign of Emperor Zhongzong of Tang. The official histories Old Book of Tang and New Book of Tang disagreed about the location where Zhang's family was from, with the Old Book of Tang indicating that the family was from Pu Prefecture (蒲州, roughly modern Yuncheng, Shanxi) and the New Book of Tang indicating that the family was from Deng Prefecture (鄧州, roughly modern Nanyang, Henan). It was said that he was studious in military strategies in his youth and had great ambitions. It was also said that he only associated with those he considered to be gentlemen, and therefore he was not well known. He passed the imperial examinations late in the Kaiyuan era (713–741) of Emperor Zhongzong's nephew Emperor Xuanzong, and initially served on the staff of Emperor Xuanzong's crown prince Li Heng before being made the magistrate of Qinghe County (清河, in modern Xingtai, Hebei). He was said to have served capably at Qinghe, and while there, paid much attention to assisting those who needed help. After his term of service was over, he returned to the Tang Dynasty capital Chang'an. At that time, the governmental affairs were dominated by the chancellor Yang Guozhong, and Zhang's friends encouraged him to meet Yang to ask for another office. Zhang refused, stating that it was inappropriate for an imperial subject to be a flatterer. He later served as the magistrate of Zhenyuan County (真原, in modern Zhoukou, Henan). It was said that at that time, the large clans of the county were both powerful and treacherous, and one of the local officials from one of those clans, Hua Nanjin (華南金), was so dominant at the county government that the people often said, "What comes from Hua Nanjin's mouth is as good as what comes from the hand of the government." After Zhang arrived at Zhenyuan, he executed Hua for his abuse of power but pardoned Hua's associates, who were able to correct their ways. He also governed the county simply, and the people favored his governance. His older brother Zhang Xiao (張曉) was also an imperial official, and both were known for their literary talent.