Little is known about Lu Yanhong's background, including when he was born, as he did not have a biography in either of the official histories of Tang Dynasty. It is known that he was from Zhongwu Circuit's capital Xu Prefecture and initially served as an officer in the Zhongwu army. As of 881, Tang was facing the crisis of the agrarian rebel Huang Chao's having captured the imperial capitalChang'an and declared himself the emperor of a new state of Qi. At that time, one of the Tang generals who had been battling Huang's forces, the eunuch Yang Fuguang, was stuck at Zhongwu Circuit, and the military governor Zhou Ji had submitted to Qi as a subject. In summer 881, though, Yang was able to persuade Zhou to renounce his allegiance to Qi and redeclare for the Tang cause. Further, Zhou contributed 8,000 men from the Zhongwu army to serve under Yang in the campaign against Huang. The 8,000 men were organized into eight corps, with Lu, Jin Hui, Wang Jian, Han Jian, Zhang Zao, Li Shitai, and Pang Cong commanding the eight corps. They subsequently followed Yang in the region, fighting against Qi forces, eventually becoming stationed at Hezhong Circuit.
As independent warlord
In fall 883, Yang Fuguang died at Hezhong. The soldiers of the eight Zhongwu corps abandoned their post in response and scattered. Lu Yanhong gathered those who were willing to follow him — including Wang Jian, Han Jian, Zhang Zao, Jin Hui, and Li Shitai — and headed south, raiding Xiang, Deng, Jin, and Yang Prefectures, pillaging them and killing many, while claiming that he was heading west to Chengdu to join the imperial cause. He reached Xingyuan around new year 884 and expelled Niu Xu the military governor of Shannan West Circuit, claiming the title of acting military governor. Emperor Xizong thereafter named him acting military governor. After taking over Shannan West Circuit, Lu named Wang, Han, Zhang, Jin, and Li the prefects of the prefectures in the circuit, but did not allow them to go to their posts. He also grew suspicious of people, and lost the heart of his followers. He was particularly suspicious of Wang and Han due to their close friendship with each other, but tried to endear them by treating them well. Wang and Han, however, could tell that he was suspecting them, and therefore they, after enticement by the powerful eunuch Tian Lingzi, fled to Chengdu in fall 884, along with Zhang, Jin, and Li, to join Tian's troops. Tian thereafter sent forces to attack Lu and defeated him. Lu then abandoned Xingyuan and fled east. Lu next attacked Xiang Prefecture, in conjunction with Qin Gao and Zhao Deyin, who were officers of the warlordQin Zongquan the military governor of Fengguo Circuit. They captured Xiang, forcing Liu Jurong the military governor of Shannan East Circuit to flee to Chengdu and allowing Zhao to take over Shannan East Circuit. Lu then pillaged Xiang, Deng, Jun, Fang, Lu, and Shou Prefectures, before heading for Xu Prefecture. Zhou Ji, upon hearing that Lu was approaching Xu, abandoned Xu and fled. Lu then took Xu and claimed the title of acting military governor of Zhongwu. The imperial government, unable to attack him, named him military governor. He remained in control until fall 886, when Qin Zongquan, who had by that point claimed imperial title, attacked him and killed him, taking over Zhongwu Circuit.