Tibetan forces exploit the troop withdrawals of the An Lushan Rebellion to conquer the Hexi-Longyou corridors, isolating the Anxi and Beiting Protectorates.
Tang Dynasty (唐朝) · HISTORICAL EVENT
Late Tang Administration of Beiting and Anxi (北庭与安西晚期经营)
北庭与安西晚期经营
The late Tang administration of Beiting and Anxi was an extraordinary military saga spanning from 763 to 791 (from the 1st year of Guande to the 7th year of Zhenyuan), during which isolated Tang garrisons held the Western Regions for nearly three decades despite being severed from central overland communication. In 755, the An Lushan Rebellion erupted, compelling the court to recall the elite border armies of the Anxi and Beiting Protectorates to liberate…

OVERVIEW
The late Tang administration of Beiting and Anxi was an extraordinary military saga spanning from 763 to 791 (from the 1st year of Guande to the 7th year of Zhenyuan), during which isolated Tang garrisons held the Western Regions for nearly three decades despite being severed from central overland communication. In 755, the An Lushan Rebellion erupted, compelling the court to recall the elite border armies of the Anxi and Beiting Protectorates to liberate the Central Plains. Taking advantage of the military vacuum, the Tibetan Empire expanded northward, capturing the Hexi Corridor and cutting off the Silk Road. Anxi Military Commissioner Guo Xin and Beiting Military Commissioner Li Yuanzhong rallied remaining veteran garrisons and diverse oasis communities in steadfast loyalty, minting local Dali Yuanbao and Jianzhong Tongbao coins to maintain governance and allying with the Uyghurs against Tibetan assaults. In 781 (the 2nd year of Jianzhong), envoys traversed Uyghur lands across several years to reach Chang'an, moving the imperial court to tears. In 790, Tibet captured Beiting, and in 791, Xizhou fell; the white-haired garrison soldiers of Anxi fought to the last man, dying for their sovereign. This protracted resistance defended Chinese territorial authority and provided vital strategic buffers for the late Tang dynasty.
EVENT TIMELINE
In the absence of central contact, Guo Xin and Li Yuanzhong cast Dali Yuanbao copper coins in Kucha and Xizhou to preserve Tang administrative authority.
Learning of Emperor Dezong's accession through travelers, the garrisons mint Jianzhong Tongbao coins to reaffirm their unbroken fealty to the throne.
Navigating nomadic trails via the Uyghur steppes, emissaries reach the capital; Emperor Dezong confers princely titles on Guo Xin and Li Yuanzhong.
Traveling home from India, monk Wukong visits Kucha and Beiting, recording the disciplined governance and Buddhist cultural life sustained by Guo Xin and Yang Xigu.
Tibetan armies coordinate with Qarluq forces to besiege Jinman City, routing a Uyghur relief army and pushing Beiting to the brink of collapse.
Tibetan troops storm Beiting; Military Commissioner Yang Xigu leads surviving troops south to Xizhou and is murdered by retreating Uyghurs.
Tibetan divisions overwhelm Xizhou and besiege Kucha; Guo Xin and his gray-haired garrison fight to the death, concluding Tang rule in the Western Regions.
Relationship graph
FULL ACCOUNT
Background
High Tang Grand Protectorates in the Western Regions
From the early Tang through the High Tang era, Emperors Taizong, Gaozong, and Empress Wu Zetian pacified the Western Tujue confederations, constructing an expansive network of civil-military protectorates across the northern and southern slopes of the Tian Shan and the Pamir Mountains. The Tang administration founded the Anxi Grand Protectorate (governing Kucha, Khotan, Kashgar, and Suyab—the Four Garrisons of Anxi) and the Beiting Grand Protectorate (centered at Jinman County in Tingzhou, administering Yizhou and Xizhou), stationing tens of thousands of garrison troops and supervising hundreds of oasis city-states.
During this zenith, international commerce flourished along the Silk Road. Tang imperial decrees were enforced across thousands of miles, realizing an era where caravans traversed uninterrupted between Yiwu and Persia. Harmonious coexistence between Han military agriculturalists and native oasis populations rooted Tang institutions deeply into Central Asian soil.
The An Lushan Rebellion and the Recall of Frontier Armies
In December 755 (the 14th year of Tianbao), frontier general An Lushan launched his rebellion from Fanyang. Rebel forces swept through Luoyang and Chang'an, forcing Emperor Xuanzong into Shu and prompting Emperor Suzong to ascend the throne at Lingwu. Confronting the imminent collapse of the dynasty, Suzong issued urgent edicts commanding all regional military commissioners to mobilize relief expeditions toward the capital.
Anxi Commissioner Li Siye and Beiting Protector Duan Xiushi led tens of thousands of elite cavalry and heavy infantry across thousands of miles to rescue the imperial house. These troops served as the primary strike force in recovering Chang'an and Luoyang. However, the redeployment stripped the Western Regions and the Hexi-Longyou corridors of their combat-ready divisions, leaving only small garrisons of aging veterans behind empty watchtowers and crumbling bastions.
Tibetan Expansion and the Severance of the Hexi Corridor
Capitalizing on the dynastic civil war, the Tibetan Empire mounted an aggressive strategic offensive northward and eastward. Following their brief occupation of Chang'an in 763 (the 1st year of Guande), Tibetan armies systematically absorbed the Longyou and Hexi corridors, conquering Liangzhou, Ganzhou, and Suzhou.
In 781 (the 2nd year of Jianzhong), Shazhou (Dunhuang) fell after an eleven-year siege due to starvation and lack of relief. The complete fall of the Hexi Corridor severed direct overland communication between the Tang central court and the Western Regions. The Anxi Protectorate, Beiting Protectorate, Xizhou, and Yizhou were transformed overnight into isolated outposts stranded thousands of miles behind enemy lines.
Course of the Event
Maintaining Imperial Orthodoxy and Minting Local Currency
In the shadow of isolation, when the court assumed the Western Regions were lost, the garrison forces displayed extraordinary loyalty. Rejecting Tibetan ultimatums, Anxi Deputy Protector Guo Xin (nephew of renowned general Guo Ziyi) and Beiting Military Commissioner Li Yuanzhong (Cao Lingzhong) rallied the remaining Chinese soldiers and multi-ethnic inhabitants to fortify city walls and resist encroachment.
From 763 through the Dali era, despite lacking imperial communications, reinforcements, or provisions, the frontier officers continued enforcing Tang statutory laws, maintaining the Dali reign title in official government registries long after the throne had changed hands in Chang'an. Furthermore, to sustain commercial transactions, tax administration, and troop stipends without incoming central copper coin supplies, Guo Xin and Li Yuanzhong established mints in Kucha and Xizhou, casting distinctive local Dali Yuanbao and Jianzhong Tongbao coins modeled after standard Tang currencies. These surviving copper coins remain archaeological monuments to the garrisons' determination to uphold dynastic legitimacy.
The Desperate Mission via the Uyghur Khaganate in 781
After holding out against continuous Tibetan assaults for over a decade, Guo Xin and Li Yuanzhong resolved to dispatch intelligence reports to Chang'an. Because the Hexi Corridor was occupied by Tibetan armies, they dispatched dozens of emissaries north across the Tian Shan, traversing the deserts of the Uyghur Khaganate in an attempt to circle around the northern wastes to reach the Central Plains.
In 781 (the 2nd year of Jianzhong), surviving envoys finally reached the imperial palace in Chang'an after years of travel through nomadic frontiers. Learning that the dragon banners of the Great Tang still flew above the ramparts of Anxi and Beiting after nearly two decades of total silence, Emperor Dezong (Li Shi) and his civil and military ministers wept openly in the imperial audience hall. Emperor Dezong proclaimed: "These two protectorates govern eleven prefectures and forty-two cities, checking the Arabs to the west and the Uyghurs to the north. Isolated in desperate domains for over twenty years, preserving their posts through a hundred battles, they are true loyal ministers and men of righteousness!"
Emperor Dezong promulgated sweeping honors: Li Yuanzhong was elevated to Grand Protector of Beiting and Military Commissioner of Yixi, while Guo Xin was named Grand Protector of Anxi, Military Commissioner of the Four Garrisons, and Prince of Wuwei. Every officer and soldier in the Western Regions was granted a seven-rank promotion. However, with the central court embroiled in domestic warlord uprisings, the empire could not spare a single soldier to march west, leaving the aging garrisons to defend themselves.
Allying with the Uyghurs and Defending the Northern Silk Route
To counteract the Tibetan economic blockade and military strangulation, Beiting commander Li Yuanzhong and his successor Yang Xigu adopted a pragmatic diplomatic policy, forming a military entente with the Uyghur Khaganate. Beiting occupied the northern slopes of the Tian Shan, bordering the southern steppes of the Uyghur realm. Tang and the Uyghurs maintained tributary and horse-silk trade relations, giving the Uyghurs significant economic stakes in regional stability.
Under Guo Xin and Yang Xigu, Tang forces transformed Yizhou, Xizhou, and Beiting into mutual defensive redoubts, supported by Uyghur cavalry patrols to repel Tibetan raids. Maintaining the northern Tian Shan route enabled the garrisons to secure essential livestock and grain while preserving a clandestine courier network linking the Western Regions to Chang'an via the Mongolian plateau.
In 785 (the 1st year of Zhenyuan), pilgrim monk Wukong (Che Fengchao) passed through the Western Regions on his journey back from India. At Kucha, Wukong met Anxi Grand Protector Guo Xin and stayed to translate Buddhist sutras; proceeding through Kashgar and Khotan, he crossed the Tian Shan to Beiting, where he was received with honors by Military Commissioner Yang Xigu. Wukong's travel memoirs confirmed that the Western Regions under Tang administration remained orderly and culturally vibrant well into the late eighth century.
The Fall of Beiting and the Martyrdom of Yang Xigu
As the Tibetan Empire marshaled further resources, its commanders changed tactics, using diplomatic concessions and subversion to peel away the Qarluq and White-Clad Turkic tribes that had previously served Tang and Uyghur interests. In 789 (the 5th year of Zhenyuan), Tibetan armies coordinated with Qarluq auxiliaries to lay siege to the Beiting Grand Protectorate at Jinman City (modern Jimsar, Xinjiang).
Military Commissioner Yang Xigu led several thousand exhausted troops in defending the walls for months while dispatching urgent pleas for Uyghur assistance. Uyghur Chief Minister Xiegan Jiasi mobilized fifty thousand horsemen south, but suffered an ambush and crushing defeat at the hands of Tibetan forces outside the citadels. In 790, Beiting was overwhelmed and sacked. Yang Xigu gathered several hundred surviving warriors, broke through the perimeter, and retreated south to Xizhou (modern Turpan).
Attempting to recoup his losses, Xiegan Jiasi mounted another counter-offensive, which ended in another defeat. In the retreat, Xiegan Jiasi attempted to coerce Yang Xigu into following him into the northern steppes; when Yang Xigu refused to abandon Chinese territory, he was murdered by Uyghur nobles during the march, resulting in the fall of the Beiting Protectorate to Tibet.
The Last Stand at Xizhou and the Fall of the Anxi Garrisons
Following the destruction of Beiting, the Four Garrisons of Anxi south of the Tian Shan were cut off from all communication. Anxi Grand Protector Guo Xin consolidated his forces within Kucha, Khotan, and Kashgar, maintaining defensive positions. By this point, the young soldiers who had stayed behind during the Tianbao era had transformed into gray-haired men in their sixties and seventies; no young recruits existed to replace fallen comrades.
Around 791 (the 7th year of Zhenyuan), Xizhou fell. Tibetan armies converged upon Kucha and the remaining Anxi citadels with overwhelming siege engines and assault columns. Donning their weathered iron armor, the white-haired veterans took to the walls, drawing their crossbows and fighting hand-to-hand until their arrows were exhausted and their swords broken.
Not a single soldier opened the gates to surrender. Guo Xin and every surviving warrior died in combat as the battlements were breached. With their deaths, the century-and-a-half administrative presence of the Tang dynasty in the Western Regions reached its conclusion, leaving behind the immortal legacy of gray-haired soldiers defending an isolated frontier.
Key Figures
Tang Commanders and Frontier Loyalists
- Guo Xin: Grand Protector of Anxi, Military Commissioner of the Four Garrisons, and Prince of Wuwei; nephew of Guo Ziyi who commanded the isolated garrisons of Anxi for nearly thirty years, falling in combat at Kucha.
- Li Yuanzhong: Originally Cao Lingzhong, Grand Protector of Beiting and Military Commissioner of Yixi; held Beiting against Tibetan assaults for over a decade and dispatched the historic 781 mission to Chang'an.
- Yang Xigu: Military Commissioner of Beiting who succeeded Li Yuanzhong, allied with the Uyghurs to defend the northern corridor, and died for the dynasty following the fall of Jinman City.
- Yan Chao: Prefect of Xizhou who directed the civil and military defense of Turpan against Tibetan sieges for over a decade.
Imperial Sovereigns and Chroniclers
- Emperor Daizong of Tang: Eighth Tang emperor whose reign endured the loss of the Hexi Corridor to Tibetan expansion, unable to send aid to the west.
- Emperor Dezong of Tang: Ninth Tang emperor who wept upon receiving the Western Regions envoys in 781, promoting all frontier soldiers by seven bureaucratic grades.
- Monk Wukong: Born Che Fengchao, a Tang Buddhist pilgrim who visited Kucha and Beiting in 785, preserving primary eyewitness accounts of Guo Xin and Yang Xigu's administration.
Outcomes and Impact
A Monument of Frontier Loyalty and National Fealty
The late Tang defense of Beiting and Anxi stands as an enduring symbol of loyalty in Chinese frontier history. Across thousands of days without contact, supplies, or reinforcements, the tens of thousands of Han and native defenders under Guo Xin and Li Yuanzhong never defected.
Their dedication—epitomized by gray-haired soldiers defending their sovereign's frontier—became a defining testament to personal loyalty and patriotic duty in Chinese historical memory.
Strategic Distraction of the Tibetan Empire
From a grand strategic perspective, the protracted defense of Anxi and Beiting created an enduring obstacle along the northern perimeter of the Tibetan Empire. To conquer these two protectorates, Tibet committed tens of thousands of elite troops and immense administrative resources to a protracted war of attrition across the Tian Shan.
This diversion relieved military pressure along the frontline borders of Longdong, Guanzhong, and Sichuan, granting the Tang central court the strategic respite required to suppress regional warlords and restore economic stability during the Zhenyuan era.
Historical Foundation for Chinese Governance in Central Asia
The prolonged resistance of the protectorates was sustained by the support of native oasis populations in Kucha, Khotan, and Turpan, alongside regional Uyghur merchant networks.
The persistence of Tang legal statutes, official reign titles, and coinage throughout three decades of isolation demonstrated the deep political legitimacy established by the Han and Tang dynasties across the Western Regions, providing an enduring legal and cultural foundation for later dynasties to administer the frontier.
Historical Evaluation
- Emperor Dezong of Tang, Imperial Edict to Guo Xin and Li Yuanzhong: In isolated cities beyond the frontier for over twenty years, your bodies dwell in distant lands while your hearts remain faithful to the throne. Protecting the frontier populations and resisting ferocious enemies, never since antiquity have loyal ministers and men of righteousness surpassed your deeds!
- Old Book of Tang (Jiu Tang Shu), Volume 120, Biography of Guo Ziyi (Appended Biography of Guo Xin): Guo Xin dwelt in the distant frontier for twenty years, his name shaking the western borders. Joining forces with Li Yuanzhong to preserve our territory, neither Su Wu nor Geng Gong exceeded their virtue.
- New Book of Tang (Xin Tang Shu), Volume 216, Treatise on the Tibetans: Anxi and Beiting were cut off from the central court for twenty years, yet Guo Xin and Li Yuanzhong maintained their citadels against the Tibetans; whenever they issued decrees, they still carried the authentic voice of the Great Tang.
- Sima Guang, Comprehensive Mirror for Aid in Government (Zizhi Tongjian), Volume 227: Guo Xin and Li Yuanzhong commanded isolated forces in distant lands. For decades following the An Lushan Rebellion, communications were severed, yet they preserved their virtue, minting Jianzhong and Dali coins to observe dynastic legitimacy. The enduring virtue of the Great Tang was stamped deeply into the hearts of the people.
- Fan Wenlan, General History of China: Tang administration in the Western Regions possessed deep social roots. When Hexi was lost following the An Lushan Rebellion, gray-haired veterans under Guo Xin and Li Yuanzhong held out in Anxi and Beiting for thirty years, fighting Tibet to the death and writing the most glorious chapter of multi-ethnic border defense in our national history.
Related Entries
- Anxi Grand Protectorate
- Beiting Grand Protectorate
- Four Garrisons of Anxi
- Guo Xin
- Li Yuanzhong
- Tibetan Empire
- Silk Road
Bibliography
- Old Book of Tang (Jiu Tang Shu), Volume 40, Treatise 20, Geography 3
- Old Book of Tang (Jiu Tang Shu), Volume 120, Biography 70 (Biography of Guo Ziyi, Appended Biography of Guo Xin)
- New Book of Tang (Xin Tang Shu), Volume 40, Treatise 30, Geography 4
- New Book of Tang (Xin Tang Shu), Volume 216, Biographies 141A–B, Tibet
- New Book of Tang (Xin Tang Shu), Volume 217, Biographies 142A–B, Uyghurs