Liu Zhang was the youngest son of Liu Yan, the Lieutenant Governor of Yi Province. In 194 AD, Liu Zhang became the lord of Yizhou after the deaths of his father and elder brothers, and he maintained peace in his realm. However, in 200 AD Zhang Lu and the Five Bushels Sect rebelled against Liu Zhang in Hanzhong, and Liu Zhang was threatened from the north. He had Zhang Lu's family executed, and requested help from Liu Bei, the former Prefect of Xu Province who had recently taken over the Jing Province from Cao Cao. In 211 AD, Zhang Song succeeded in convincing Liu Bei to form an alliance with Liu Zhang, but they secretly plotted a takeover of Yi Province behind his back.
In 212 AD, Zhang Su (the elder brother of Zhang Song) revealed that his brother was plotting against him with Liu Bei, so Liu Zhang had Zhang Song executed, but he decided not to inform Liu Bei, letting him plot against him for the time being. He planned to have Gao Pei and Yang Huai ambush Liu Bei at a banquet after surrendering to him, but Liu Bei easily saw through their plan and had the two executed for "disrespect". Liu Bei took over their armies and advanced south on Chengdu, the administrative capital of Yizhou.
Liu Zhang's son Liu Xun commanded some of his forces against the army of Liu Bei at Luo Castle in 214 AD, and with the assistance of his general Zhang Ren, they mortally wounded Liu Bei's strategist Pang Tong and began to rout Liu Bei's forces. However, Liu Bei succeeded in convincing several of Liu Zhang's generals to defect to his side, and he defeated Liu Xun's army. Liu Bei conquered Luo Castle, and with the assistance of his generals Huang Zhong and Wei Yan, Liu Bei made a final push on Chengdu.
Fortunately for Liu Zhang, Zhang Lu's former officers Ma Chao and Ma Dai headed south with an army to assist Liu Zhang in maintaining the peace in Yi Province, and they engaged Liu Bei's general Zhang Fei in a duel at the Battle of Jiameng Pass. Neither side succeeded in defeating the other, but Ma Chao was convinced to defect by Liu Bei, as like Ma Chao, Liu Bei also sought justice. Ma Chao convinced his cousin Ma Dai to join him, and they turned against Liu Zhang.
The cowardly Liu Zhang retreated to Chengdu Castle, relying on his generals to make a last-ditch attempt to defeat Liu Bei. Zhang Fei defeated his officer Yan Yan in a duel during Yan Yan's ambush of his unit in the Mianzhu forest in front of Chengdu, and Yan Yan defected to serve as one of Liu Bei's commanders. Also joining Liu Bei were Wu Lan, Fa Zheng, Li Yan, and Lei Tong. Liu Zhang was forced to surrender after Liu Bei and his army conquered Chengdu, and he was given rank in Liu Bei's administration of his new land of Shu. Liu Zhang later fled to Eastern Wu, where he died in 219 AD.