 He controlled a state in the Hanzhong region, which he had named Hanning () until 215, when he surrendered to Cao Cao, whom he would serve until his death one year later.Upon the death of his father, Zhang Heng (), Zhang Lu inherited control of the Celestial Masters religious group, and therefore became its third leader (the first was Zhang Lu's grandfather Zhang Daoling).The religion enjoyed its greatest popularity in Yi Province (covering present-day Sichuan and Chongqing), but when Zhang Lu took control of the group, it was being challenged in the area by a shamanistic religion led by Zhang Xiu (, no family relation to Zhang Lu).