Guiyi Circuit

The Guiyi Circuit, also known as the Guiyi Army (, 848–1036 AD), Golden Mountain Kingdom of Western Han (, 909–911), Dunhuang Kingdom of Western Han (, 911–914), was a Chinese regional military command and later an autonomous dynastic regime nominally subordinate to the Tang dynasty, the Five Dynasties, and the Northern Song dynasty. The Guiyi Circuit was controlled by the Zhang family from the second half of the 9th century to the 10th century and then the Cao family until the 11th century. The Guiyi Circuit was headquartered in Shazhou (沙州; modern-day Dunhuang).

Background
The Hexi Corridor was an important part of the Silk Road, connecting Central Asia with Northwest China. After the An Lushan Rebellion, the Hexi Corridor was occupied by the Tibetan Empire. Around the 770s or the 780s, Shazhou, otherwise known as Dunhuang, was occupied by the Tibetans.

Zhang family
After some 60 years of Tibetan rule, Tibet entered its Era of Fragmentation and was torn by civil war by 851. Tibetans in the Dunhuang region become part of a group known as wamo in Chinese historical sources.

In 848 Zhang Yichao, a resident of Shazhou, led an uprising and captured Shazhou and Guazhou from the Tibetans.

By 850 Zhang had captured Ganzhou, Suzhou, and Yizhou. Zhang claimed the title of acting prefect of Shazhou and submitted a petition to Emperor Xuānzong of Tang, offering his loyalty and submission.

In 851 Zhang captured Xizhou (Gaochang). Envoys from Shazhou reached the Tang court and the emperor responded by naming Zhang's territory the Guiyi Circuit and made Zhang Yichao the Guiyi Jiedushi (歸義節度使, Governor of the Guiyi Circuit) and Cao Yijin his secretary general.

In 856 Zhang attacked the Tibetans and defeated them.

By 861 the Guiyi Circuit had extended its authority to Guazhou, Ganzhou, Suzhou, Yizhou, Lanzhou, Shanzhou, Hezhou, Minzhou, Liangzhou, and Kuozhou. In 866 Zhang Yichao defeated the Tibetan general bLon Khrom brZhe ( 論恐熱 Lun Kongre) and seized Luntai (Ürümqi) and Tingzhou. However they were immediately captured by the Kingdom of Qocho afterwards. Xizhou was also captured by the Uyghurs. BLon Khrom brZhe was an attack commissioner in the region. After Langdarma's death in 842, he fought constantly with another commissioner, Shang Bibi. He was captured by Shang Bibi's subordinate, Tuoba Huaiguang, in 866 and sent to the Tang court.

In 867 Zhang Yichao departed for the Tang court after his brother Yitan, who had been staying in Chang'an as a hostage, died. His nephew Zhang Huaishen succeeded him as Guiyi Jiedushi.

In 869 the Kingdom of Qocho attacked the Guiyi Circuit but was repelled.

In 870 the Kingdom of Qocho attacked the Guiyi Circuit but was repelled.

In 872 Zhang Yichao died at court.

In 876 the Kingdom of Qocho seized Yizhou.

In 880, Qocho attacked Shazhou, but was repelled.

Around the years 881 and 882, Ganzhou and Liangzhou slipped from the control of the Guiyi Circuit. The Ganzhou Uyghur Kingdom would establish itself in Ganzhou by 894. In Liangzhou, the Tibetan state of Xiliangfu established itself by 906.

In 890 Zhang Huaishen was assassinated and his cousin Zhang Huaiding succeeded him.

In 892 Zhang Huaiding died and left his son in the care of Suo Xun (索勳), son-in-law of Zhang Yichao. Suo Xun declared himself Guiyi Jiedushi.

In 894 Suo Xun was killed by a local aristocrat by the name of Li Mingzhen and Zhang Yichao's daughter. Li's sons shared control of Guiyi Circuit afterwards.

In 896 Li Mingzhen's sons were ousted and Zhang Chengfeng (張承奉), a grandson of Zhang Yichao, became jiedushi.

In 904, Zhang Chengfeng attacked Qocho and seized Yizhou (Hami) and Xizhou (Gaochang).

In 910 Zhang Chengfeng received news of the Tang dynasty's demise and declared himself Emperor Baiyi. The Guiyi Circuit was renamed Kingdom of Jinshan.

Kingdom of Jinshan
The rulers of Guiyi in Dunhuang briefly called themselves "emperors" for a short period after the final collapse of the Tang dynasty.

In 910 Zhang Chengfeng established a kingdom known as the Xihan Jinshan (西漢金山國 Xīhàn Jīnshānguó), "The Golden Mountain Kingdom of the Western Han," and gave himself the title of "Son of Heaven." This was followed by an invasion by the Ganzhou Uyghurs.

In 911 the Ganzhou Uyghurs attacked again and the Kingdom of Jinshan was forced to become a lesser partner in an alliance with the Ganzhou Uyghurs. The Great Chancellor (大宰相) and the elders of Jinshan State made a treaty with the Ganzhou Uyghurs, recognizing their superiority. The relationship between the two was prescribed as

''"...the Khan is the father, and the Son of Heaven is the son..." (...可汗是父,天子是子...) ''

In 914 Cao Yijin usurped the throne and abolished the kingdom, reverting the name to Guiyi Army.

Cao family


In 914 Cao Yijin (曹議金) usurped the throne and restored the name Guiyi Circuit.

In 916 Cao Yijin married a Ganzhou Uyghur princess and sent delegations to the Later Liang.

In 924 the Ganzhou Uyghur Khagan died and his successors Renmei and Diyin declared war on each other, with Diyin coming out victorious.

In 925 Cao Yijin defeated the Ganzhou Uyghurs.

In 926, Diyin died, and Aduoyu (阿咄欲) became the Khan of the Ganzhou Uyghurs. Aduoyu married a daughter of Cao Yijin.

Kingdom of Guiyi
In 931 Cao Yijin declared himself as Lord (令公) and Great King-reclaiming-the-west (拓西大王). The Cao rulers continued using the Chinese reign era names, and maintained cordial relations with the Chinese heartland and its socio-political system.

In 934 Cao Yijin married his daughter to the king of Khotan.

In 935 Cao Yijin died and was succeeded by his son, Cao Yuande.

In 939 Cao Yuande (曹元德) died and was succeeded by his brother Yuanshen (曹元深).

In 944 Cao Yuanshen died and his brother Yuanzhong (曹元忠) succeeded him. Cao Yuanzhong's reign was characterized by progress in agriculture, transportation, and printing. Relationship with the Ganzhou Uyghurs remained relatively stable during this period.

In 950 the first depiction of fire lances appeared in Shazhou.

In 974 Cao Yuanzhong died and his nephew Cao Yangong (曹延恭) succeeded him.

In 976 Cao Yangong died and his brother Yanlu (曹延祿) succeeded him. Yanlu married a Khotanese princess.

In 1002 Cao Yanlu's nephew Cao Zongshou rebelled in Shazhou. Cao Yanlu and his brother Cao Yanrui (曹延瑞) committed suicide. Cao Zongshou became ruler of Guiyi.

In 1014 Cao Zongshou died and his son Cao Xianshun (曹賢順) succeeded him.

In 1028 the Tanguts defeated the Ganzhou Uyghurs.

In 1030 Cao Xianshun surrendered to the Tanguts.

In 1036 the Tanguts, who later established the Western Xia, annexed the Kingdom of Guiyi.

Religion


Buddhism was prevalent in Dunhuang (Shazhou) during the Guiyi period, and had been before as well under Tibetan rule. Under Tibetan rule, the number of Buddhist temples increased from 6 to 19 and more than 40 new caves were created. Confucian classics were also taught in Buddhist monasteries. Many of Zhang Yichao's family converted to Buddhism. He also studied Buddhism in his youth. A manuscript from Dunhuang contains a signature that reads, "written by Buddha's secular disciple Zhang Yichao." After Zhang Yichao took over, the Buddhists of Dunhuang reconnected with the Tang court and he presented the work of Cheng'en, a monk from the Hexi Corridor, to the Tang court to support the Buddhist restoration movement of emperors Xuanzong and Yizong. Texts that had been lost in Dunhuang due to warfare were reproduced using Tang copies. Despite Zhang's association with Buddhism, due to a shortage of manpower, he made many temple households independent peasants to satisfy the demands of recruitment.

As the Tang dynasty collapsed and entered the Five Dynasties and Ten Kingdoms period, Buddhism in Dunghuang gravitated towards lay Buddhism and apocryphal sūtras rather than scripture-based tradition. At the beginning of the Guiyi period, the Buddhist master Faheng and his disciples Fajing and Fahai delivered lectures in Dunhuang. After 883, lectures by monks are no longer mentioned in manuscript colophons and only lay devotional practices such as building caves, erecting statues, and addresses to common people are recorded.

In addition to Buddhism, discoveries of Manichaean, Nestorian Christian, and Zoroastrian documents and other artifacts at Mogao Caves dating back to the Guiyi era reveal their coexistence in a multi-religious world.

Sogdians of Dunhuang
During the Tang and subsequent Five Dynasties and Song dynasty, large communities of Sogdians lived in China, especially in the multicultural entrepôt of Dunhuang, Gansu, a major center of Buddhist learning and home to the Buddhist Mogao Caves. While the region occasionally fell under the rule of different states (the Tang, the Tibetan Empire, and later the Western Xia led by the Tanguts), it retained its multilingual nature as evidenced by an abundance of manuscripts (religious and secular) in Chinese and Tibetan, but also Sogdian, Khotanese (another Eastern Iranian language native to the region), Uyghur, and Sanskrit.

From the Chinese surnames listed in the Tang-era Dunhuang manuscript Pelliot chinois 3319V (containing the following text: 石定信右全石丑子石定奴福延福全保昌張丑子李千子李定信), the names of the Nine Zhaowu Clans (昭武九姓), the prominent ethnic Sogdian families of China, have been deduced. Of these the most common Sogdian surname throughout China was Shi (i.e. 石), whereas the surnames Shi (i.e. 史), An, Mi (i.e. 米), Kang, Cao, and He appear frequently in Dunhuang manuscripts and registers. Zhang Yichao appointed An Jingmin as vice commissioner of Guiyi, Kang Shijun as prefect of Guazhou, and Kang Tongxin as magistrate of some towns to the east. The influence of Sinicized and multilingual Sogdians during this Guiyijun (歸義軍) period (c. 850 - c. 1000 AD) of Dunhuang is evident in a large number of manuscripts written in Chinese characters from left to right instead of vertically, mirroring the direction of how the Sogdian alphabet is read. Sogdians of Dunhuang also commonly formed and joined lay associations among their local communities, convening at Sogdian-owned taverns in scheduled meetings mentioned in their epistolary letters.