Zhang Liang 張良 (d. 186 BCE), courtesy name Zifang 子房， was an eminent minister of Liu Bang 劉邦, the founder of the Han dynasty 漢 (206 BCE-220 CE). His ancestors had served the kings of the state of Han 韓 in high positions.
When Han was conquered by Qin and the Qin dynasty 秦 (221-206) was established, Zhang Liang planned to hire an assassin to kill the First Emperor 秦始皇帝 (r. 246-210). When the Emperor passed Bolangsha 博浪沙 (modern Yuanyang 原陽, Henan) on an inspection tour, Zhang Liang tried laying an ambush, but he failed. Disappointed of these outcomings, he retired to Xiapi 下邳 (modern Suining 睢寧, Jiangsu) and dedicated himself to the study of the art of war.
When the first uprisings against the Qin dynasty started in 209, Zhang Liang immediately assembled his own troops. Soon, he joined Liu Bang, whom he was to serve for the coming decades as an excellent military commander and strategic advisor. When Liu Bang conquered the capital of the Qin, Xianyang 咸陽, Zhang Liang stressed that it would not be a good example to loot the palace and the city. Instead, Liu Bang should better withdraw to Bashang 覇上 and await the arrival of the more powerful warlord Xiang Yu 項羽. By this act Liu Bang had won the support of the population of the capital region, which later proved decisive in his war against Xiang Yu. When Xiang Yu arrived in Xianyang, his troops plundered the Qin palace. With humble words, following the further suggestoins of Zhang Liang, Liu Bang tried to appease Xiang Yu and was thus able to withdraw without harm.
During the war with Xiang Yu, Liu Bang was heavily defeated in the battle of Pengcheng 彭城 in 205. Zhang Liang urged Liu Bang to create an alliance with other warlords, namely Ying Bu 英布, Peng Yue 彭越 and Han Xin 韓信. After the disastrous battles of Xingyang 滎陽 and Chenggao 成臯, Liu Bang wanted to adopt the plan of Li Yiji (sic!) 酈食其 to promise his allies their own kingdoms to be established after the defeat of Xiang Yu. Yet Zhang Liang contradicted and stressed that the only chance for Liu Bang's survival would be to conquer the whole empire. When this in fact happened in 202, Zhang Liang was given the title of Marquis of Liu 留侯. He did not occupy an eminent office but remained an important advisor. So he suggested to confer some of the powerful generals titles of nobility to pacify them; to establish the capital in the Guanzhong region 關中 in the west, where the Zhou and the Qin dynasties had had their capitals; and to retain his oldest son Liu Ying 劉盈 as crown prince.