Zhang He originally served as an officer of Yuan Shao, the Governor of Ji Province and a powerful warlord from northern China. Zhang He assisted in Yuan Shao's suppression of the Yellow Turban Rebellion of 184 AD, and he continued to serve under him during his campaigns in the 190s. In 200 AD, Zhang He was present at the Battle of Guandu, where Yuan Shao's massive army of 200,000 troops fought Cao Cao's smaller army of 80,000 troops. Zhang He was accused of false charges by Guo Tu, an intelligent strategist of Yuan Shao, and he was also defeated in battle. Rather than be executed by Yuan Shao, Zhang He decided to defect to Cao Cao. Zhang He proved himself in the 202 AD Battle of Ji Province, during which he assisted in the defeat of Yuan Shao's sons Yuan Shang and Yuan Tan alongside Cao Cao and his officer Xiahou Dun. Zhang He later distinguished himself at the Battle of Changban and the Battle of Chibi in 208 AD against the military of Liu Bei, Governor of Xinye, and the navy of Sun Quan, the Governor of Wujun. Zhang He fought in the battles following Chibi, and he also served in the campaign against Ma Chao in 211 AD.
It would be Zhang He's campaigns against Shu Han that set him apart from the rest of Cao Cao's generals. In 215 AD, Zhang He began service in Hanzhong when Liu Bei's army, acquired from the former officers of Governor Liu Zhang of Yi Province, invaded Hanzhong in an attempt to annex the land of his ancestor Liu Bang. Zhang He defeated Lei Tong at Hexi and killed him, but he was later defeated at the Battle of Baxi by Wu Lan. During the Battle of Hanzhong, Zhang He engaged Zhuge Liang's army in an ambush from the cliffsides of the plateau, but his attacks on the Shu main camp were repelled by the brave general Zhao Yun, one of Liu Bei's most-trusted officers. Zhang He was forced to retreat, and he later took command of units during the invasion of Eastern Wu by Cao Pi (Emperor of Cao Wei from 220, after the death of his father, Cao Cao) in 222 AD. Zhang He fought at the Battle of Dongkou and the Third Battle of Ruxukou.
In 228 AD, Zhang He began a new series of commands during the Northern Expeditions of Zhuge Liang of newly-declared Shu Han, a state that was created in 223 AD as Lord Liu Bei was dying. Zhuge Liang was the Chancellor of Shu Han, as Emperor Liu Shan was an ineffective ruler, and Zhuge Liang exercised all military power in the country. His first invasion defeated Jiang Wei and Ma Zun at the Battle of Tianshui, forcing Jiang Wei to join Shu Han's ranks as one of Shu's new strategists. Zhang He managed to recapture much of the lost lands after Zhuge Liang retreated, and in the 229 AD Battle of Jieting, Zhang He destroyed the army of Zhuge Liang's general Ma Su, who encamped on a mountaintop away from water supplies. Zhang He proceeded to defeat Shu in several battles while serving under the command of the brilliant Wei strategist Sima Yi, but his career ended in 231 AD at the Battle of Mt. Qi. The battle was a Wei victory, but Sima Yi unwisely sent Zhang He to pursue Zhuge Liang's retreating army. Zhang He was ambushed on the Mumen Road and was struck in the right leg by an arrow, killing him.