The Anshi Rebellion was a war waged by Tang generals An Lushan and Shi Siming from the last years of Emperor Xuanzong of the Tang Dynasty to the early years of Emperor Daizong of China. It was a civil war for sovereignty with the Tang Dynasty and a turning point in the rise and fall of the Tang Dynasty. The civil war caused a large loss of population and a sharp decline in national strength in the Tang Dynasty. Because the commanders who launched the rebellion against Tang Dynasty were mainly An Lushan and Shi Siming, this incident was named An Shi. Because it broke out in Tianbao period of Xuanzong in Tang Dynasty, it was also called Tianbao Rebellion.
After the Anshi Rebellion, the Tang Dynasty also lost control of the surrounding ethnic minorities. Together with the Anshi Rebellion, the Tang Dynasty deployed heavy troops to the mainland in Longyou, Hexi and Shuofang areas, which led to the emptiness of border defense. The western Tubo people took the opportunity to enter, and the Longyou and Hexi corridors were exhausted. The Tang Dynasty still controlled the Anxi North Court in the Western Regions. A few decades later, around 790 AD, the Tang Dynasty lost the Anxi North Court in the Western Regions. From then on, the Tang dynasty was in a precarious state, and it was even more precarious.