Zhang Anshi (; died 13 September 62 BCE[1]), courtesy name Ziru (子孺), was a Chinese politician of the Han dynasty. He was a son of Zhang Tang.
He was a precocious student who attracted attention in a famous incident. During an Imperial progress, to which he was attached in a subordinate capacity, three boxes of books were missing. However, he was able to repeat the contents of each so accurately that upon the recovery of the books, they were found to tally exactly with his description. Emperor Wu immediately appointed him to high office; Emperor Wu promoted him further after Zhang Tang's death.
He played a part in deposing Liu He as emperor, and subsequently rose under Emperor Xuan to be President of the Board of War, in succession to Huo Guang. After his death, his posthumous title was "Marquis Jing" (敬侯).
Zhang Anshi was well known to be cautious in both his mannerisms and how he is perceived by others. As the President of the Board of War, he came to know that Emperor Xuan had promoted his son Yanshou. Anshi then attempted to resign his position, but was refused by Emperor Xuan. Later, he advised Yanshou to leave the capital and become an official elsewhere, as he worried that with both father and son in high positions within the capital, they would become targets.
Zhang Anshi's elder brother Zhang He was close to Emperor Wu's first crown prince Liu Ju. With Liu Ju's suicide after his failed rebellion, Zhang He was implicated and sentenced to death. Anshi pleaded for clemency; He's sentence was commuted to castration. Anshi's youngest son Pengzu was then given to He and regarded as He's heir.