# Qara Khitai

The Qara Khitai, or Kara Khitai (simplified Chinese: 哈剌契丹; traditional Chinese: 喀喇契丹; pinyin: Kālā Qìdān or Chinese: 黑契丹; pinyin: Hēi Qìdān; lit. 'Black Khitan'), also known as the Western Liao (Chinese: 西遼; pinyin: Xī Liáo), officially the Great Liao (Chinese: 大遼; pinyin: Dà Liáo), was a dynastic regime based in Central Asia ruled by the Yelü clan of the Khitan people. Being a rump state of the Khitan-led Liao dynasty, Western Liao was culturally Sinicized to a large extent, especially among the elites consisting of Liao refugees.
The dynasty was founded by Yelü Dashi (Emperor Dezong), who led the remnants of the Liao dynasty from Manchuria to Central Asia after fleeing from the Jurchen-led Jin dynasty conquest of northern China. The empire was usurped by the Naimans under Kuchlug in 1211; traditional Chinese, Persian, and Arab sources consider the usurpation to be the end of the dynasty, even though the empire would not fall until the Mongol conquest in 1218. Some remnants of the Qara Khitai would form the Qutlugh-Khanid dynasty in southern Iran.
The territories of the Qara Khitai corresponded to parts of modern-day China, Kazakhstan, Kyrgyzstan, Mongolia, Tajikistan and Uzbekistan. The Anushtegin dynasty, the Karluks, Qocho kingdom, the Kankalis, and the Kara-Khanid Khanate were vassal states of the Qara Khitai at some point in history. Chinese and Muslim historiographical sources, such as the History of Liao, considered the Qara Khitai to be a legitimate Chinese dynasty.

## Names

The Qara Khitai took on trappings of a Chinese state and inherited the dynastic name "Great Liao". Hence, Chinese, Korean, Japanese and Vietnamese historians generally refer to the empire as the "Western Liao", emphasizing its continuation from the Liao dynasty.
The name "Qara Khitai", commonly used by Central Asian tribes to refer to the dynasty, is also commonly used in Western scholarly works. The term is often translated as the Black Khitans in Mongolian, but its original meaning is unclear today. In Modern Mongolian, "Kara-Khitan" is rendered "Хар Хятан" (Khar Khyatan). Since no direct records from the empire survive today, the only surviving historical records about the empire come from foreign sources.
"Black Khitans" (黑契丹) has also been seen used in Chinese. "Qara," which literally means "black," corresponds with the Liao's dynastic color black and its dynastic element water, according to the theory of five elements (wuxing). The Jurchens referred to the empire as "Dashi" or "Dashi Linya" (after its founder), to reduce any claims the empire may have had to the old territories of the Liao dynasty. Muslim historians initially referred to the state simply as "Khitay" or "Khitai;" they may have adopted this form of "Khitan" via the Uyghurs of Kocho in whose language the final -n or -ń became -y. Only after the Mongol conquest did the state begin to be referred to in the Muslim world as the "Kara-Khitai" or "Qara-Khitai." Khitan is the origin of "Cathay", a European name for China.

## History
### Origin

The Qara Khitai empire, also known as the Western Liao dynasty, was the remnant offshoot of the Khitan-led Liao dynasty. From 1114 to 1125, the Jurchen-led Jin dynasty conquered the Liao. In 1122, two groups of Khitans fled westward to escape the Jin invasion. One of these groups was led by Yelü Dashi, who joined the Liao emperor, Tianzuo, at the border of the Western Xia kingdom. Dashi was captured by the Jin in 1123 and forced to lead them to Tianzuo's camp, resulting in the capture of the entire Liao imperial family except for Tianzuo and one of his sons. Dashi later rejoined Tianzuo but the emperor was captured in early 1125 and died at the Jin court in 1128.

### Founding of the Qara Khitai

In 1124, Yelü Dashi fled northwest and established his headquarter at the military garrison of Kedun (Zhenzhou) on the Orkhon River. Dashi secured the allegiance of the garrison forces numbering 20,000 and set himself up as gurkhan (universal khan). He conquered two Jin tribes in 1129. In 1130, Dashi led his host further west in search of new territory. Within a year, he had established himself as suzerain of Qocho and gained a foothold in Transoxiana. In 1131, he attacked the Karakhanids at Kashgar but was repelled. He later returned in 1134 and conquered the Karakhanid city of Balasaghun (in modern Kyrgyzstan), resulting in the vassalization of the nearby Kankalis, Karluks, Kyrgyz, and the Kingdom of Qocho. Kashgar, Khotan, and Beshbalik.In 1137, he defeated the Western Karakhanids near Khujand and annexed Fergana and Tashkent. Yelü Dashi's host was further bolstered by 10,000 Khitans who had previously been subjects of the Karakhanids. They went on to conquer Kashgar, Khotan, and Beshbalik.

### Battle of Qatwan

The Western Karakhanids were vassals of the Seljuk Empire and the Karakhanid ruler Mahmud II appealed to his Seljuk overlord Ahmad Sanjar for protection. In 1141, Sanjar with his army arrived in Samarkand. The Khitans were invited by the Khwarazmians (also a vassal of the Seljuks) to conquer the lands of the Seljuks and responded to an appeal to intervene by the Karluks who were involved in a conflict with the Karakhanids and Seljuks.
Khitan forces ranging from 20,000 to 700,000 depending on the source met in battle with Seljuk forces numbering 100,000. While many Muslim sources suggested that the Khitan forces greatly outnumbered the Seljuks, some contemporary Muslim authors also reported that the battle was fought between forces of equal size. The Khitans were also said to have been given a reinforcement of 30,000–50,000 Karluk horsemen.
The Battle of Qatwan took place on the Qatwan steppe, north of Samarkand, on 9 September 1141. The Khitans attacked the Seljuk forces simultaneously, encircled them, and forced the Seljuq center into a wadi called Dargham, about 12 km from Samarkand. Encircled from all directions, the Seljuq army was destroyed and Sanjar barely escaped. Figures of the dead ranged from 11,000 to 100,000. Among those captured at the battle were Seljuq military commanders and Sanjar's wife. The Seljuk defeat resulted in the loss of all of Transoxiana to the Khitans.
After his victory, Yelü Dashi spent 90 days in Samarkand, accepting the loyalty of Muslim nobles and appointing Mahmud's brother Ibrahim as the new ruler of Samarkand. Dashi allowed the Muslim Burhan family to continue to rule Bukhara. After this battle, Khwarazm became a vassal state of the Khitans. In 1142, Dashi sent Erbuz to Khwarazm to pillage the province, which forced Atsiz to agree to pay 30,000 dinars annual tribute.

### Territorial extent

The Qara Khitai in 1143 constituted a realm encompassing a territory roughly equivalent to modern Xinjiang, Kyrgyzstan, Uzbekistan, Tajikistan, and south Kazakhstan. Under the empire's direct rule was the region around their capital, Balasagun. Around it were the subject kingdoms of Qocho, the eastern and western Karakhanids, Khwarazm, and the Karluk tribes. Its western border was defined by the Amu Darya, but the Khitans were active in Khorasan until the 1180s while Balkh remained under their rule until 1198. In the north they bordered the Yenisei Kyrgyz north of Lake Balkhash until 1175 when they retreated further south. The southern boundary stretched from Balkh to Khotan to Hami. The boundary of the empire in the east is hard to define but the Khitans exercised some sovereignty over the Naimans east of the Altai Mountains until 1175.

### Conflict with Jin

Simultaneously during the invasion of Central Asia, Dashi also sent invasion forces to attack the Jin and retake Liao territory, however these efforts proved fruitless and ended in defeat. Yelü Dashi had originally hoped to recapture northern China from the Jin dynasty and restore the territories once held by the Liao dynasty. However, he soon discovered the relative weakness of his empire vis-a-vis the Jin dynasty and gave up the idea after a disastrous attack on the Jin dynasty in 1134. The Western Liao continued to defy Jin supremacy in 1146, and continued sending scouts and small military units against the Jin in 1156, 1177, 1185, 1188. This indicates that for the first 2 generations there remained considerable interest in reconquest.

### Xiao Tabuyan (r. 1143-1150)

When Yelü Dashi died, his wife and paternal cousin, Xiao Tabuyan (1143-1150), became regent for their son. Tabuyan used the honorific titles of empress Gantian, Gurkhan, and Dashi. Her successors retained the titles of Gurkhan and Dashi. While the History of Liao states that Tabuyan was merely a regent, Muslim sources state that she held unlimited power over the realm as is implied by her titles.
Taking advantage of Dashi's death, the Oghuz invaded Bukhara but were likely driven off sometime before 1152, when they were located in Khuttal and Balkh. In 1143, the Seljuk sultan Ahmad Sanjar attacked Khwarazm and occupied Khorasan. Although Atsiz once again became a Seljuk subject, in practice he continued to pay tribute to the Qara Khitai. According to Ibn al-Athir, Atsiz was only spared due to Sanjar's fear of the Khitans. Sanjar may have also wielded power in Transoxiana until his death, as implied by an 1148 coin minted in Bukhara. In 1144, Qocho offered tribute to the Jin. The Jin sent a messenger named Niange Hannu to the Qara Khitai. When he met Tabuyan in 1146, he refused to dismount in her presence and proclaimed that he had come from a superior court as an emissary of the Son of Heaven and demanded her to show obeisance to the Jin court. When he threatened that the Jin were ready to send an army to invade their lands, the empress executed him. His fate only became known to the Jin in 1175 as a result of deserters from the Qara Khitai.

### Yelü Yilie (r. 1150-1163)

The son, Yelü Yilie, ruled from 1150 to 1163. The only known act he was involved in according to the History of Liao during his 13 year reign was taking a census of people over 18 years old. The result was 84,500 households in total. The small number, less than Samarkand's 100,000 households in the pre-Mongol era, was likely due to being geographically limited to only Balasagun and the surrounding area that the Khitans directly ruled. It is unknown if even the sedentary population was counted in the census.
During Yilie's reign, the Oghuz rebelled against Ahmad Sanjar in Khorasan. The Khitans were at least partly responsible for this due to displacing the Oghuz in Transoxiana and pushing them into Balkh, where they were heavily taxed by Sanjar due to his losses at Qatwan. The Oghuz rebellion was caused by the governor of Balkh, Amir Qumach, who had enlisted Oghuz support against the Ghurids in 1152. However the Oghuz defected to the Ghurids, allowing them to temporarily occupy Balkh. After retaking the city, Qumach increased the tax burdens on the Oghuz. In 1153, the Oghuz killed a Seljuk tax collector and Qumach retaliated by attacking them. In the conflict that followed, Qumach and his sons were killed, and Sanjar was defeated and captured. The Oghuz plundered Khorasan whil Sanjar escaped captivity in 1156 but failed to restore his former authority. He died the following year.
There is no evidence that the Khitans were directly involved in the conflict of Khorasan, however the Turkic leaders all paid tribute to them to gain their favor during this time. The lack of Khitan involvement may be due to conflict with the Jin to the east. In 1156, a Jin army led by Po Longdun met with a Qara Khitan raiding group several hundred strong at Kedun. The Khitan force withdrew after negotiations. Khitans under Jin rule rebelled in 1161. One of the rebel leaders, Saba, planned to defect to the Qara Khitai, but was killed by another Khitan leader, Yelü Wowo, who proclaimed himself the new Khitan emperor. Wowo was killed by the Jurchens in 1163.
The Qara Khitai played a key role in the conflict between their vassals: the Karluks, Karakhanids, and Khwarazm. In early 1156, the Karluks killed Ibrahim Tabghach Khan, the Western Karakhanid ruler of Samarkand. Ibrahim was succeeded by his son, Mahmud, for a year before Ibrahim's brother, Ali Chaghri Khan, took power. Ali wanted to avenge his brother and soon after his accession, killed one of the Karluk leaders. In early 1156, the Karluks fled to Khwarazm and sought the help of its ruler, Il-Arslan, who sent an army against Samarkand. Ali sent for help from his sovereign, the Qara Khitai, who instructed the ruler of the Eastern Karakhanids to come to his aid. The Eastern Karakhanids sent 10,000 riders to reinforce Samarkand, however the Khwarazmian force was too large to comfortably engage, and a truce was achieved with the help of religious dignitaries. The Karluks were reinstalled to their former posts and Il-Arslan returned to Khwarazm. The Karluks continued to cause trouble for Samarkand until the Qara Khitai ordered the Western Karakhanids to drive them from Bukhara and Samarkand to Kashgar. Mas'ud Tabghach Khan, the brother of Ibrahim, took the occasion to purge Transoxiana of the Karluks.

### Yelü Pusuwan (r. 1164–1177)

Yelü Pusuwan (r. 1164–1177) was explicitly chosen for succession by her brother, Yelü Yilie. Known as Empress Chengtian, Pusuwan refocused the Qara Khitai's attention westward. In 1165, the Qara Khitai participated in Mas'ud Tabghach Khan's invasion of Balkh and Andkhud, then under Oghuz domination, and incorporated Balkh under Qara Khitai rule lasting until 1198. In 1172, the Qara Khitai crossed the Amu Darya to attack Khwarazm, whose ruler Il-Arslan had neglected to pay tribute. Il-Arslan fell ill on the way to battle and let a Karluk commander lead his forces while he remained behind. The Khwarazmian army was soundly defeated and Il-Arslan returned to Khwarazm where he died in March 1172. However no new tribute collection agreement was enforced, possibly due to satisfaction from the spoils that the Qara Khitai had already collected from their victory.
Il-Arslan's death led to a succession struggle between his two sons in which the Qara Khitai were involved. The younger son, Sultan Shah, was enthroned with the aid of his mother, Terken Khatun, who ruled in his name. The older brother, Tekish, fled to the Qara Khitai court and asked for their support in installing him as the new ruler of Khwarazm in return for a share of its treasures and annual tribute. Pusuwan sent her husband, Xiao Duolubu, with a large army to support Tekish's claim. Sultan Shah and his mother fled Khwarazm and Tekish was enthroned on 11 December, 1172. Terken Khatun enlisted the help of Mu'ayyid al-Din Ai-Aba, a former Seljuk amir, to fight for their cause. However he was defeated and executed in Khwarazm in July 1174. Sultan Shah and his mother then fled to Dihistan, which Tekish then conquered and put to death Terken Khatun. Sultan Shah fled to Tughan Shah, the son of Mu'ayyid, in Nishapur, and then to the Ghurids.
Tekish soon fell out with the Qara Khitai. Despite owing his crown to them, Tekish found the conduct of their emissaries to be insulting and their demands exceeding the original agreement. In the mid 1170s, Tekish killed the leader of the emissaries who was part of the Qara Khitai royal family, and ordered the Khwarazmian notables (ayan) to kill every Qara Khitai who entered Khwarazm. Pusuwan summoned Sultan Shah, who had already been in contact wih the Qara Khitai court after realizing the Ghurids would not challenge Tekish for his claim, and sent a large army with him led by her husband to oust Tekish.
During the conflict with Khwarazm, the Qara Khitai also faced rebellions by tribes to the north and east. In the early 1170s, the Qara Khitai sent an imperial son-in-law named Abensi against the Yebulian and other tribes in the north. Abensi could not defeat them and the conflict lasted until 1175. In the same year, the Naimans and Kangly surrendered to the Jin. In 1177, the Qara Khitai sent spies into Jin territory and news of them reached the Jin court. In response, the Jin resettled the Khitans in the northwest to the northeast. In addition, the border market of Suide was closed due to fear that it was being used as a hub for spies.
While her husband was away, Pusuwan developed a romantic relationship with his brother, Xiao Fuguzhi. She planned to get rid of her husband in order to spend more time with his brother, however her father-in-law caught wind of her plans and conducted a coup. Xiao Wolila surrounded the palace with his troops and killed both his son and the empress.

### Yelü Zhilugu (r. 1177-1211)
#### Khwarazm war

Xiao Wolila installed Yelü Zhilugu (r. 1178–1211), the second son of Yelü Yilie, on the throne.
At the time of Zhilugu's accession, a large Qara Khitai army under the command of the late empress's husband, Xiao Duolubu, was accompanying Sultan Shah to Khwarazm. Tekish managed to halt the Qara Khitai advance by flooding the Amu Darya's dikes and blocking their path. Xiao Duolubu decided to retreat but Sultan Shah offered him a large sum in return for leaving part of his troops behind. These troops accompanied Sultan Shah to fight against the Oghuz in Khorasan. In 1181, they helped him seize Merv, Sarakhs, Nasa, and Abiward.
In 1181, the Kipchaks under Qara Ozan Khan, established in a marriage alliance with Tekish, attacked Talas in Qara Khitai territory.
In 1182, Tekish attacked Bukhara. According to his own description, the city dwellers preferred the rule of non-believers to his Muslim army. Tekish captured the city but it is uncertain how long he held it. The lack of references as well as dismissive portrayal of his time there, referred to as "the business in Transoxania," probably implies a short duration. By 1193, Bukhara was again ruled by the Karakhanid vassal of the Qara Khitai. Praises of Ibrahim Arslan Khan, the Karakhanid ruler, were sung by the Bukharan sadr around this time.
The conflict between Tekish and his brother Sultan Shah continued in Khorasan until 1193 when Sultan Shah died. Although Tekish took precautions to guard the Amu Darya against Qara Khitai support of his brother during the conflict, the Qara Khitai offered no further responses to the matter. It is likely that there was a rapprochement between Tekish and the Qara Khitai court before 1194 and at the very latest before 1198, when the Qara Khitai aided Tekish against the Ghurids. The cessation of hostilities was probably a financial agreement as several Muslim sources assert that Tekish dutifully paid tribute to the Qara Khitai and ordered his son to continue to do so.

#### Tribal conflict

In the east, there is some vague evidence according to Song dynasty spy reports that the Qara Khitai had tried to ally with the Tangut Western Xia dynasty to attack the Jin in 1185. Although nothing came of it, the Jin evidently took the Qara Khitai threat seriously. In 1188, Wanyan Xiang, a leading Jin official, came back from a tribute collecting mission among the northern tribes and presented to the emperor a detailed program and map to prevent their subjects from defecting to the Qara Khitai. Wanyan Xiang was promoted for his contributions. In 1190, one of the Qara Khitai subject tribes surrendered to the Jin, which may have been the result of this new policy.
In the early 1190s, the khan of the Keraites, Toghrul, fled to the Qara Khitai seeking military support after he was ousted by his own family. When no support was forthcoming, Toghrul returned to Mongolia in 1196 seeking Temüjin's help. Toghrul later made an alliance with the Jin, through which he received his other title, Ong Khan, in 1197.

#### Ghurid war

In 1198, Muhammad of Ghor, one of the Ghurid rulers, seized Balkh from the vassal of the Qara Khitai. The Qara Khitai were urged by the Khwarazm Shah Tekish (who was also in conflict with the Ghurids) not to let this slide, as the other Ghurid ruler Ghiyath al-Din Muhammad would seize Khwarazm and Transoxiana. The Qara Khitai invaded Ghurid lands around Kurzuban (around modern Taloqan). At first they were victorious, killing and capturing many Ghurid soldiers, but they were surprised by an attack in the night. When Ghiyath al-Din's reinforcements arrived in the morning, the Qara Khitai army was badly defeated, suffering 12,000 losses. The Qara Khitai turned to Tekish for compensation for the damage incurred and sent Xiao Duolubu to Khwarazm to collect. Tekish in turn asked the Ghurids for help. Ghiyath al-Din agreed to help with the compensation on the condition that Tekish offered his obedience to the Caliph and returned territories taken earlier by the Qara Khitai. As a result, Khwarazm managed to provide some manner of compensation to the Qara Khitai for their losses incurred fighting against the Ghurids, using Ghurid funds. Tekish died in 1200 and his son Muhammad II of Khwarazm started his reign as a tributary of the Qara Khitai.
The Ghurids took advantage of Tekish's death to conquer certain parts of Khorasan, including Merv and Sarakhs, where they installed Hindu Khan, Muhammad II's nephew, as their subject. In September 1201, Muhammad II marched on Merv. Hindu Khan tried to escape to the Qara Khitai, but he was killed before reaching them. Muhammad II's conflict with the Ghurids in Khorasan continued for several years. In 1204, Muhammad of Ghor attacked Khwarazm directly. Muhammad II hurried back to Khwarazm and opened the dikes and burned the meadows in an effort to slow the Ghurid advance. The Khwarazmian forces suffered a heavy defeat against the Ghurids near a canal east of Gurganj and Muhammad II fled to the Qara Khitai. The Qara Khitai sent to his aid a force of 10,000 or 40,000 led by Tayangu and the Karakhanid rulers Uthman ibn Ibrahim and his cousin Taj al-Din Bilge Khan, the ruler of Otrar. The Ghurids retreated south upon receiving news of Qara Khitai reinforcements.
The sequence of events after the Ghurid retreat is unclear. One version of events has the Ghurids being pursued by Khwarazmian forces until they fell into Qara Khitai hands. Another version states that the Ghurids first won a victory against the Qara Khitai before being overtaken from exhaustion. According to another version, the Ghurids split their forces while fleeing from the Khwarazmian army and the Qara Khitai caught them in the desert. The Qara Khitai then attacked the Ghurids with 20,000 horsemen while a strong wind blowing towards the Ghurids resulted in a Qara Khitai victory. All versions of events, however, agree that the Qara Khitai chased the Ghurids to Andkhud, a village between Merv and Balkh, where Muhammad of Ghor took refuge in a castle. As the Qara Khitai were about to capture him, Uthman intervened and negotiated the Ghurids' surrender. This act has been attributed to solidarity between Muslim leaders. According to one account, Uthman advised the Ghurids to move their forces in and out of the castle by night to create the appearance of reinforcements arriving, thereby boosting their negotiating position. Tayangu and the Qara Khitai agreed to let Muhammad of Ghor go in return for a ransom payment. According to one account, the payment was everything Muhammad of Ghor had in his possession, while another account states that the payment was much more modest, consisting of one elephant and an additional payment. The Ghurids kept Balkh and the Amu Darya was agreed upon as the border between the two realms.
Muhammad of Ghor later returned to avenge himself against the Qara Khitai. In the summer of 1205, the Ghurid viceroy in Balkh seized Tirmidh and destroyed a Qara Khitai army stationed there. Plans were underway for a bridge to be built across the Amu Darya to facilitate a Ghurid invasion of Transoxiana. However before any of this came to fruition, Muhammad of Ghor was killed on 13 March, 1206 and the Ghurid invasion came to an end.

#### Rise of Khwarazm

Muhammad II of Khwarazm convinced the governor of Tirmidh to surrender and returned it to Qara Khitai control. In return, the Qara Khitai recognized the Khwarazm Shah's suzerainty over all of Khorasan.
Muhammad II saw the Qara Khitai's recognition of his claims as a sign of weakness and started interfering in Transoxiana in 1207 when Sanjar, son of a shield maker, revolted against local leadership in Bukhara. Representatives of the Burhan family, who were responsible for tax collection, went to the Qara Khitai court for help. While the Qara Khitai reaffirmed the Burhan family's position, they offered no concrete assistance. In the absence of Qara Khitai backing, the notables of Bukhara and Samarkand sought out Muhammad II for help. Before challenging the Qara Khitai, Muhammad II made preparations by compromising with the Ghurids on certain domains and enlisting the aid of the Karakhanid ruler Uthman ibn Ibrahim, who had been insulted by the Qara Khitai's refusal to grant him a royal princess in marriage.
In 1207, Muhammad II entered Bukhara and exiled Sanjar to Khwarazm. The Qara Khitai sent an army against him and warfare continued for some time before Tort-Aba, the new Khwarazmian commissioner in Samarkand, and the isfahbad of Kabud-Jama (in Tabaristan) defected to the Qara Khitai. Both sides retreated but the Qara Khitai took many captives. There are accounts that Muhammad II was actually taken captive at one point but was not recognized and released.
During Muhammad II's absence, his brother Ali Shah (viceroy in Tabaristan) and Kozli (commander in Nishapur) had tried to set themselves up as rulers of Khorasan. When Muhammad II returned, Kozli fled and both he and his son were killed soon after, and Ali Shah fled to Firuzkuh. Muhammad II restored his position in Khorasan by conquering Herat and Firuzkuh. In 1208-9, Ali Shah was executed. Khwarazm returned to paying tribute to the Qara Khitai in 1209-10 when Muhammad II was planning a campaign against the Kipchaks. Not wanting to sever relations with the Qara Khitai at that moment, Muhammad II left the matter of tribute to his mother, who welcomed the Qara Khitai emissaries with great respect. However Mahmud Tai, the Qara Khitai's chief vizier, was unconvinced and reported that Muhammad II was unlikely to pay tribute again.
Late in the period it expanded far to the south as the Khwarezmian Empire until it was conquered by the Mongols in 1220, two years after the Qara Kitai. In the south the Kara-Khanid vassals were lightly held and engaged in various conflicts with each other, the Qara Kitai, Khwarezm and the Gurids.

#### Rebellions in the east

In 1204, the Qara Khitai put down a rebellion in Khotan and Kashgar. In 1209, Qocho rebelled against the Qara Khitai. The Qara Khitai commissioner was chased into a high building where he was put to death. The Uyghur ruler, Barchuq Art Tegin, reported the incident to the Qara Khitai, but at this point individuals at Qocho had already started defecting to the Mongols. When Genghis Khan's messengers arrived at Qocho, the Uyghur ruler offered his allegiance to the Mongol khan. Genghis gave Barchuq his daughter in return for his attendance at court as well as a sizable tribute. In late 1209 or early 1210, when Merkit refugees arrived in Qocho, Barchuq attacked them and drove them off. He made haste to report his loyal behaviour to Genghis, accompanying it with tribute. In 1211, the Uyghur Idiqut had an audience with Genghis on the Kerulen River. In the same year, another vassal of the Qara Khitai, the Karluk Arslan Khan surrendered to Genghis.

### Kuchlug's usurpation and end of the Khanate

In 1208, a Naiman prince, Kuchlug, fled his homeland after being defeated by Mongols. Kuchlug was welcomed by the Qara Khitai, and was allowed to marry Zhilugu's daughter. However, in 1211, Kuchlug revolted, and later captured Yelü Zhilugu while the latter was hunting. Zhilugu was allowed to remain as the nominal ruler but died two years later, and many historians regarded his death as the end of the Qara-Khitai empire. In 1216, Genghis Khan dispatched his general Jebe to pursue Kuchlug; Kuchlug fled, but in 1218, he was finally captured and decapitated. The Mongols fully conquered the former territories of the Qara-Khitai in 1220.

### Aftermath

The Qara Khitais became absorbed into the Mongol Empire; a segment of the Qara-Khitan troops had previously already joined the Mongol army fighting against Kuchlug. Another segment of the Qara-Khitans, in a dynasty founded by Buraq Hajib, survived in Kirman as a vassal of the Mongols, but ceased to exist as an entity during the reign of Öljaitü of the Ilkhanate. The Qara-Khitans were dispersed widely all over Eurasia as part of the Mongol army. In the 14th century, they began to lose their ethnic identity, traces of their presence however may be found as clan names or toponyms from Afghanistan to Moldova. Today a Khitay tribe still lives in northern Kyrgyzstan.

## Administration

The Khitans ruled from their capital at Balasagun (in today's Kyrgyzstan), directly controlling the central region of the empire. The rest of their empire consisted of highly autonomous vassalized states, primarily Khwarezm, the Karluks, the Kingdom of Qocho of the Uyghurs, the Kankalis, and the Western, Eastern, and Fergana Kara-Khanids. The late-arriving Naimans also became vassals, before usurping the empire under Kuchlug.
The Khitan rulers inherited many administrative elements from the Liao dynasty, including the use of Confucian administration and imperial trappings. The empire also adopted the title of Gurkhan (universal Khan). The Khitans used the Chinese calendar, maintained Chinese imperial and administrative titles, gave its emperors reign names, used Chinese-styled coins, and sent imperial seals to its vassals. Although most of its administrative titles were derived from Chinese, the empire also adopted local administrative titles, such as tayangyu (Turkic) and vizier.
The Khitans maintained their old customs, even in Central Asia. They remained nomads, adhered to their traditional dress, and maintained the religious practices followed by the Liao dynasty Khitans. The ruling elite tried to maintain the traditional marriages between the Yelü king clan and the Xiao queen clan, and were highly reluctant to allow their princesses to marry outsiders. The Qara-Khitai Khitans followed a mix of Buddhism and traditional Khitan religion, which included fire worship and tribal customs, such as the tradition of sacrificing a gray ox with a white horse. In an innovation unique to the Qara Khitai, the Khitans paid each of their soldiers a salary.
The empire ruled over a diverse population that was quite different from its rulers. The majority of the population was sedentary, although the population suddenly became more nomadic during the end of the empire, due to the influx of Naimans. The majority of their subjects were Muslims, although a significant minority practiced Buddhism and Nestorianism. Although Chinese and Khitan were the primary languages of administration, the empire also administered in Persian and Uyghur.

## Association with China

In Chinese historiography, the Qara Khitai is most commonly called the "Western Liao" (西遼) and is considered to be an orthodox Chinese dynasty, as is the case for the Liao dynasty. The history of the Qara Khitai was included in the History of Liao (one of the Twenty-Four Histories), which was compiled officially during the Yuan dynasty by Toqto'a et al.
After the fall of the Tang dynasty, various dynasties of non-Han ethnic origins gained prestige by portraying themselves as the legitimate dynasty of China. Qara Khitai monarchs used the title of "Chinese emperor", and were also called the "Khan of Chīn". The Qara Khitai used the "image of China" to legitimize their rule to the Central Asians. The Chinese emperor, together with the rulers of the Turks, Arabs, India and the Byzantine Romans, were known to Islamic writers as the world's "five great kings". Qara Khitai kept the trappings of a Chinese state, such as Chinese coins, Chinese imperial titles, the Chinese writing system, tablets, seals, and used Chinese products like porcelain, mirrors, jade and other Chinese customs. The adherence to Liao Chinese traditions has been suggested as a reason why the Qara Khitai did not convert to Islam. Despite the Chinese trappings, there were comparatively few Han Chinese among the population of the Qara Khitai. These Han Chinese had lived in Kedun during the Liao dynasty, and in 1124 migrated with the Khitans under Yelü Dashi along with other people of Kedun, such as the Bohai, Jurchen, and Mongol tribes, as well as other Khitans in addition to the Xiao consort clan.
Qara Khitai's rule over the Muslim-majority Central Asia has the effect of reinforcing the view among some Muslim writers that Central Asia was linked to China even though the Tang dynasty had lost control of the region a few hundred years before. Marwazī wrote that Transoxania was a former part of China, while Fakhr al-Dīn Mubārak Shāh defined China as part of "Turkestan", and the cities of Balāsāghūn and Kashghar were considered part of China.

### Legacy

The association of Khitai with China meant that the most enduring trace of the Khitan's power is names that are derived from it, such as Cathay, which is the medieval Latin appellation for China. Names derived from Khitai are still current in modern usage, such as the Russian, Bulgarian, Uzbek and Mongolian names for China. However, the use of the name Khitai to mean "China" or "Chinese" by Turkic speakers within China, such as the Uyghurs, is considered pejorative by the Chinese authorities, who tried to ban it.

## Seals

In Autumn of the year 2019 a Chinese type bronze seal was discovered near a Caravanserai that was located near the Ustyurt Plateau. This seal has a weight of 330 grams and has the dimensions of 50x52x13 millimeters with a handle that is 21 millimeters in height. The inscription of the seal is written in Khitan large script and contains 20 characters. This was the first seal that could be confidently attributed to the a Western Liao period as it is attributed to have been created during the 3rd month of the year Tianxi 20 (or the year 1197 in the Gregorian calendar) during the reign of Emperor Yelü Zhilugu. The discovery of this seal further indicated that the Qara Khitai Khanate adopted the Chinese administrative practice, as such seals were commonly used in the Imperial Chinese government apparatus.
As of 2020 it is unclear if the same regulations on seals existed in Qara Khitai as did in imperial China and if the sizes of Western Liao seals were standardised or not.

## Sovereigns of Qara Khitai

Sovereigns of Qara Khitai (Western Liao) :
| Temple names (廟號 miàohào) | Posthumous names (諡號 shìhào) | Birth Names | Convention | Period of Reign | Era names (年號 niánhào) and their according range of years |
| Dezong (德宗 Dézōng) | Emperor Tianyou Wulie (天祐武烈皇帝 Tiānyòu Wǔliè Huángdì) | Yelü Dashi (耶律大石 Yēlǜ Dàshí or 耶律達實 Yēlǜ Dáshí)$^1$ | use birth name | 1124–1144 | Yanqing (延慶 Yánqìng) 1124 or 1125–1134 Kangguo (康國 Kāngguó) 1134–1144 |
| Not applicable | Empress Gantian (感天皇后 Gǎntiān Huánghòu) (regent) | Xiao Tabuyan (蕭塔不煙 Xiāo Tǎbùyān) | "Western Liao" + posthumous name | 1144–1150 | Xianqing (咸清 Xiánqīng) 1144–1150 |
| Renzong (仁宗 Rénzōng) | did not exist | Yelü Yilie (耶律夷列 Yēlǜ Yíliè) | "Western Liao" + temple name | 1150–1164 | Shaoxing (紹興 Shàoxīng) or Xuxing (Xùxīng 續興)$^2$ 1150–1164 |
| Not applicable | Empress Dowager Chengtian (承天太后 Chéngtiān Tàihòu) (regent) | Yelü Pusuwan (耶律普速完 Yēlǜ Pǔsùwán) | "Western Liao" + posthumous name | 1164–1178 | Chongfu (崇福 Chóngfú) 1164–1178 |
| did not exist | Mozhu (末主 Mòzhǔ "Last Lord") or Modi (末帝 Mòdì "Last Emperor") | Yelü Zhilugu (耶律直魯古 Yēlǜ Zhílǔgǔ) | use birth name | 1178–1211 | Tianxi (天禧 Tiānxī or Tiānxǐ 天喜)$^3$ 1178–1218 |
| did not exist | did not exist | Kuchlug (屈出律 Qūchūlǜ) | use birth name | 1211–1218 | |
| $^1$ "Dashi" might be the Chinese title "Taishi", meaning "vizier"; or, it could mean "Stone" in Turkish, as the Chinese transliteration suggests. $^2$ Recently discovered Western Liao coins have the era name "Xuxing", suggesting that the era name "Shaoxing" recorded in Chinese sources may be incorrect. $^3$ A recently discovered Western Liao coin with the era name "Tianxi" (天喜) suggests that the era name "Tianxi" (天禧) recorded in Chinese sources may be incorrect. ||||||