The An Lushan Rebellion
Also called: An–Shi Rebellion
The rebellion launched in 755 by the military governor An Lushan and his lieutenant Shi Siming lasted until 763. The Tang lost and regained Chang’an, but afterwards declined as regional governors entrenched themselves and the codified order collapsed.

Qiu Ying · Public domain · Source
Xuanzong restored good government in the Kaiyuan era (713–741), the height of the Tang (the Kaiyuan Reign). But as peasants abandoned their land and the equal-field and militia systems faltered, he turned to paid recruits and set up military governors (jiedushi) on the frontiers who held both troops and revenue. In 751 a Tang army under Gao Xianzhi, a man of Goguryeo descent, was defeated by the Abbasids at Talas. In his later years Xuanzong doted on Yang Guifei, and power lay with Li Linfu and Yang Guozhong.
An Lushan, who held the three commands of Fanyang, Pinglu and Hedong, rose at Fanyang in December 755 on the pretext of removing Yang Guozhong, took Luoyang and proclaimed the state of Yan. When Chang’an fell the next year, Xuanzong fled to Sichuan; at Mawei station his mutinous troops forced the death of Yang Guifei. An Lushan was murdered by his son in 757, but Shi Siming and his son carried on, and only with Uyghur help did the Tang end the rebellion in 763.
Thereafter the Tang was plagued by provincial regimes (fanzhen) whose governors controlled troops, administration and taxes, and the equal-field and zu-yong-diao systems gave way to the two-tax system. The family of Li Zhengji, of Goguryeo descent, ruled Shandong as governors of Pinglu-Ziqing for some fifty years. New landlords with large estates rose in place of the old aristocracy, and the poems of Li Bai and Du Fu sang of the age’s glory and turmoil.