Zhang Lu, courtesy name Gongqi, was a man of Feng County in Pei State. His grandfather Zhang Ling, living as a sojourner in Shu, studied the Way on Mount Huming and composed Daoist writings with which he beguiled the common people; since those who received the Way from him had to contribute five pecks of rice, people called them the 'rice bandits'. When Zhang Ling died, his son Zhang Heng practiced his Way, and when Zhang Heng died, Zhang Lu in turn practiced it. Records, Wei 8 §61
According to the Biography of Liu Yan, Zhang Lu's mother practiced the Way of spirits and kept a youthful appearance, and she frequently visited Liu Yan's household. Liu Yan, Governor of Yi Province, made Zhang Lu Major Supervising Righteousness and sent him with a Major of a Separate Command to lead troops against Su Gu, Administrator of Hanzhong; Zhang Lu ambushed and killed the Major of a Separate Command who had gone with him and took over his followers. The Biography of Liu Yan records that Zhang Lu stayed in Hanzhong, cut the plank roads through the valleys and killed the Han envoys. Records, Wei 8 §61Records, Shu 1 §7
When Liu Yan died and his son Liu Zhang succeeded him, Liu Zhang, on the grounds that Zhang Lu was not obedient, killed Zhang Lu's mother and all his household. The Biography of Liu Zhang records that the two thereby became enemies, that Liu Zhang repeatedly sent Pang Xi and others to attack Zhang Lu but was defeated every time, and that because many of Zhang Lu's followers were in Baxi, he made Pang Xi Administrator of Baxi to hold Zhang Lu off. Records, Wei 8 §62Records, Shu 1 §13
Zhang Lu took Hanzhong, taught the people by the Way of spirits and styled himself 'Lord Teacher'. Those who came to study the Way were at first called 'spirit soldiers'; once they had received the Way and their faith was firm they became 'libationers' and led followers, and those who led many became 'great libationers at the head of a parish'. He taught them to be sincere and trustworthy and not to deceive, and had the sick confess their own faults; Chen Shou wrote that on the whole it resembled the Yellow Turbans. Records, Wei 8 §62
The libationers built charity lodges like the post stations of today and hung up rice and meat there, so that travelers could take as much as their bellies required. It was said that if anyone took too much, the Way of spirits would make him ill. Lawbreakers were pardoned three times before being punished; no senior officials were appointed and all governing was done by the libationers, and the people and the non-Han peoples were content with it. In this way he held Ba and Hanzhong for nearly thirty years. Records, Wei 8 §63
The Han court, unable to attack him by force, made Zhang Lu General of the Household Who Pacifies the People and concurrently Administrator of Hanning, and Zhang Lu merely sent tribute. When one of the people found a jade seal in the ground and his subordinates wished to exalt Zhang Lu as King of Hanning, his Officer of Merit Yan Pu admonished him: 'Appointing officials on the emperor's authority already gives you ample power; there is no need for the trouble of calling yourself king. Do not be the first to invite disaster.' Zhang Lu followed this advice. During the rebellion of Han Sui and Ma Chao, tens of thousands of households of the people west of the passes fled to him through the Ziwu Valley. Records, Wei 8 §64–65
In the 3rd month of the 16th year of Jian'an (211), Cao Cao sent Zhong Yao to attack Zhang Lu, on the grounds that he occupied Hanzhong. Liu Zhang, alarmed at this news, followed Zhang Song's advice and sent Fa Zheng to welcome Liu Bei and have him attack Zhang Lu, but Liu Bei, even after advancing to Jiameng, did not attack Zhang Lu at once and instead won over the people. Later, when Ma Chao attacked the commanderies and counties of Longshang, Zhang Lu sent his senior commander Yang Ang to help him, and when Ma Chao, unable to enter Jicheng, fled to Hanzhong, Zhang Lu took him in. The Biography of Ma Chao records that Zhang Lu was not a man with whom great plans could be made, so that Ma Chao was inwardly depressed and secretly asked Liu Bei to accept his surrender. Records, Wei 1 §109Records, Shu 2 §27–29Records, Wei 25 §27 · 32Records, Shu 6 §29
In the 3rd month of the 20th year of Jian'an (215), Cao Cao led a western expedition in person, came out through San Pass, and in the 7th month reached Yangping. Zhang Lu wished to surrender Hanzhong, but his younger brother Zhang Wei would not agree and blocked the pass with tens of thousands of men. According to the Annals of Emperor Wu, Zhang Wei and the commander Yang Ang and others built walls across the mountains for more than ten li; Cao Cao, unable to take them, pretended to withdraw, and when their guard relaxed he made a night attack over the steep ground, routed them and beheaded the commander Yang Ren. Zhang Wei and the others fled by night, and Zhang Lu, his forces broken, fled to Bazhong. Records, Wei 8 §66Records, Wei 1 §146–147
Hearing that Yangping Pass had fallen, Zhang Lu wished to submit, but Yan Pu said, 'If you go now, driven into a corner, your merit will be slight; if you rely on Du Hu, go to Pu Hu and resist, and only then submit, your merit will be great.' So he fled into the Southern Mountains and entered Bazhong. When those around him wished to burn all the treasures and storehouses, Zhang Lu said, 'I originally wished to submit to the state but have not yet been able to carry it out; the treasures and storehouses belong to the state,' and he sealed them up and left. Cao Cao, entering Nanzheng, praised this highly, and since Zhang Lu had originally harbored good intentions, sent men to comfort and persuade him. Records, Wei 8 §67–68
In the 11th month of that year Zhang Lu came out of Bazhong with his whole family and the remainder of his followers and surrendered. Cao Cao received him, appointed him General Who Guards the South, treated him with the courtesy due a guest, and enfeoffed him as Marquis of Langzhong with a fief of 10,000 households. Zhang Lu's five sons, Yan Pu and others all became full marquises, and Cao Cao took Zhang Lu's daughter as a wife for his son Cao Yu. Liu Bei too sent Huang Quan to welcome Zhang Lu, but Zhang Lu had already returned to Nanzheng and surrendered to Cao Cao. Records, Wei 8 §68Records, Wei 1 §152Records, Shu 13 §4
When Zhang Lu died he received the posthumous title Marquis Yuan, and his son Zhang Fu succeeded him. Chen Shou's main text does not record the year of his death. Records, Wei 8 §69
In his assessment, Chen Shou wrote that Zhang Yan and others and Zhang Lu, who abandoned the bands of brigands, joined the ranks of meritorious officials, escaped danger and destruction and preserved the sacrifices of their ancestral temples, did better than Gongsun Zan, Gongsun Du, Tao Qian and Zhang Yang, who, though they held provinces and commanderies, were worse off than common men. Records, Wei 8 §71