The An Lushan Rebellion, also known as the An–Shi Rebellion (安史之亂), was a major civil war of the Tang dynasty. The rebellion was instigated by the jiedushi An Lushan in December 755 from his base in Fanyang with the official goal of ousting Chancellor Yang Guozhong from power. While the two's long-standing feud was common knowledge, the warlord's grievances were secretly driven by a resentment for Guozhong's leadership of the Order of the Ancients sect known as the Golden Turtles, a clandestine organization influencing the government behind-the-scenes and of which An himself was a member. Unable to secure his candidacy as Guozhong's successor, the infuriated An founded a splinter faction, the Yeluohe, which simultaneously became the public face of his elite forces. His army adopted the slogan "slay Guozhong, purge the lords" as their rallying cry, initially portraying themselves as not rebels but loyalists who sought to revitalize the vitality of the Tang.
Their onslaught as they struck southwestwards towards the Yellow River corridor was devastating, and when they captured the secondary Tang capital of Luoyang in 756, An proclaimed himself emperor of the new state of Yan, effectively declaring secession from the Tang. At this point, only the formidable Tong Pass held the Yeluohe at bay from an outright conquest of Chang'an. The Tang generals Gao Xianzhi and Feng Changqing defending this critical checkpoint became victims of political intrigue by Guozhong, however, and were wrongfully executed. This left Chang'an wide open to the forces of Yan, and it fell immediately after.
The Fall of Chang'an precipitated the flight of Emperor Xuanzong and his court, among them Chancellor Yang Guozhong and the Emperor's favorite concubine Yang Guifei. Not far along their journey, a mutiny at Mawei Station by their guards resulted in the deaths of both Guozhong and Yang Guifei.