In the mid-8th century, the Tang Dynasty flourished, but Emperor Xuanzong's later neglect of state affairs created deep political cracks. An Lushan, a powerful general of Sogdian-Turkic origin, gained exceptional favor by becoming the 'adopted son' of the Emperor's beloved consort, Yang Guifei, despite being 16 years older than her. Their relationship was famously close; she even performed the 'Se-a' (washing the baby) ceremony for him, treating the massive general like a newborn. This bizarrely intimate bond allowed An Lushan free access to the palace to build a formidable power base and outmaneuver his rivals. This eventually sparked a bitter jealousy and power struggle with Prime Minister Yang Guozhong. When Yang Guozhong attempted to prove An's disloyalty by arresting his associates in the capital, he pushed the cornered general toward an inevitable military confrontation.
In late 755, An Lushan officially revolted, claiming his goal was to remove the corrupt Yang Guozhong. He captured Luoyang and declared himself emperor of the Yan Dynasty. His forces quickly overran the central plains. The Tang court, which had concentrated its elite forces at the borders while leaving the interior hollow, was unable to offer effective resistance against the seasoned rebel troops.
As the rebels advanced on Chang'an, Emperor Xuanzong fled toward the rugged safety of Sichuan. At Mawei Relay Station, the imperial guards mutinied, blaming the Yang family for the empire's ruin. They executed Prime Minister Yang Guozhong and forced the heartbroken emperor to order the death of his beloved Yang Guifei. This tragedy forced a critical choice upon the Tang leadership. While Xuanzong insisted on continuing his flight to the safety of Sichuan, Crown Prince Li Heng was urged by his advisors and regional supporters to stay and lead the resistance. Consequently, the party split: Xuanzong proceeded south to Sichuan, while the Crown Prince headed north to the frontier fortress of Lingwu. There, he was declared Emperor Suzong, establishing a new center of resistance. Although the Tang Dynasty was in a desperate state with its heartland occupied, the emergence of the Lingwu court allowed generals like Guo Ziyi to regroup and seek vital military aid from the Uyghur Khaganate.
As the rebellion stagnated, the rebel leadership began to implode from within. An Lushan, suffering from extreme obesity, diabetes, and progressive blindness, became increasingly paranoid and psychotically violent. He frequently whipped or killed his servants and generals for trivial reasons. His eldest son, An Qingxu, who was often beaten by his father, lived in constant terror. When An Lushan planned to bypass him for the succession in favor of a younger son, An Qingxu conspired with the eunuch Li Ting'er. In early 757, they entered An Lushan's tent while he slept and stabbed him in his massive belly. It is said that because of his extreme girth, his intestines spilled out before he could even find his sword, marking a pathetic end for the self-proclaimed emperor.
After An Lushan's death, the rebel leadership fractured. Shi Siming, a powerful general who had briefly surrendered to the Tang, returned to the rebellion and eventually eclipsed An Qingxu. In 759 AD, when An Qingxu was besieged by Tang forces at Yecheng, Shi Siming led a massive relief army to break the siege. However, after the victory, Shi Siming lured An Qingxu and his brothers to his camp. There, he publicly condemned An Qingxu for the 'unforgivable sin' of murdering his own father and had them all executed. By using the murder of An Lushan as a moral pretext, Shi Siming seized the throne of the Yan state and revitalized the rebellion for a final, bloody phase.
The pattern of patricide repeated with Shi Siming, who had seized control after murdering An Qingxu. Shi Siming was a brilliant but terrifyingly cruel commander who executed his own officers for any minor setback. He openly preferred his younger son, Shi Chaoqing, and planned to execute his elder son, Shi Chaoyi. Fearing for his life and encouraged by his subordinates who also hated Shi Siming's tyranny, Shi Chaoyi led a coup in 761 and had his father strangled. This repeated internal betrayal shattered the morale of the rebel army. With the help of the Uyghur Khaganate and led by Tang generals like Guo Ziyi and Li Guangbi, the Tang forces finally suppressed the fractured rebellion by 763. The empire was saved, but its glory was forever dimmed, giving way to an era of decentralized military rule.