Yelü Dashi

Yelü Dashi (alternatively ), courtesy name Zhongde (重德), also known by his temple name as the Emperor Dezong of Western Liao (西遼德宗), was the founder of the Western Liao dynasty (Qara Khitai). He initially ruled as king from 1124 to 1132, then as emperor and gurkhan from 1132 to 1143. He was also known in Muslim sources as Nūshī Taifū, Qushqin Taifū or Qushqīn, son of Baighū. A member of the imperial Yelü clan, he fled the Liao dynasty in northern China as it was on the verge of destruction by the Jurchen-led Jin dynasty and moved westward into Central Asia where he established a new empire.

Name
There are various theories regarding his name. According to Sugiyama Masaaki, Dashi (大石) might be a borrowing from Chinese title taishi (太師). Qidan Guo Zhi suggests was just a nickname.

Early life
Yelü Dashi was a minor member of the Liao dynasty's imperial Yelü clan and an eighth generation descendant of the Emperor Taizu of Liao. His date of birth is not entirely clear but may have been in either 1087 or 1094, according to various accounts of the history of Liao. The History of Liao describes him as "well-versed in Khitan and Chinese scripts, excelled in riding and archery, and had passed the highest imperial examination in the fifth year of the Tianqing era" (1115 AD).

In the twilight of the dynasty he held increasingly important administrative and military posts. He held posts of governorship of Taizhou (泰州, in modern Tailai County, Heilongjiang) and Xiangzhou (祥州, in modern Wanjinta Township, Nong'an County).

Jin invasion and end of the Liao dynasty
The Jurchens, a Tungus people who lived north of Liao dynasty in Manchuria, established the Jin dynasty in 1115 and began to dominate Manchuria. The Jin dynasty formed an alliance with the Song dynasty to attack the Liao, and by 1122 the Jin had captured a large part of Liao territories, including its supreme capital of Chifeng. The Liao emperor Tianzuo fled west, and his uncle Prince Yelü Chun then formed the short-lived Northern Liao in its southern capital of Liao Nanjing (now Beijing). The Song forces under the command of Tong Guan attacked Northern Liao from the south, but under the command of Dashi and Xiao Gan, the Liao army was able to repel the Song attacks. However, the Jin dynasty continued to advance from the north, and eventually captured the southern capital in 1123. Just before the Jin takeover, Dashi slipped away with 7000 of his troops to join the Emperor Tianzuo.

Dashi was later captured by the Jin dynasty, but escaped five months later to rejoin the emperor. However, the emperor signalled his intention to attack the Jin. Dashi thought this was folly, as the Jin was in a strong position. Unable to convince the emperor, in 1124 Dashi led a band of Liao officials northwest to the Liao garrison town of Kedun. Emperor Tianzuo was captured by the Jin dynasty in 1125 and the Liao dynasty ended.

Move to the west
He started out with 10,000 horses, a small force assuming at least 2 horses for every man. His new base of Kedun was about 1500 km northwest of Beijing, probably along the Orkhon River in Bulgan Province. It was an old Liao garrison with 20,000 tribal horsemen, good pasture, and protected by desert to the east and south. He probably planned to build up his forces and attack the Jurchens when an opportunity arose, which it never did. He took control of the imperial horse herds and gained some power over the local tribes. Alliances with the Western Xia to the south or the Song dynasty to the southeast never developed. As the Jurchens grew stronger the disorganized lands to the west became increasingly attractive. There had already been significant tribal movements westward, including some Khitans. On 13 March 1130 he headed west with less than 20,000 men. After some minor fighting with the Yenisei Kyrgyz he established a new base on the Emil River just east of the current Chinese border about 1500 km west of Kedun. At about the same time, he was welcomed by the ruler of the Kingdom of Qocho (about 500 km southeast of Emil near Turfan) who became his ally or vassal. In the summer of 1131 he attacked Kashgar (over 1000 km east of Qocho), was soundly defeated and withdrew to Qocho. The Jurchens sent an army after him, but this failed because of the distance.

Qara Khitai (Western Liao) established
In 1132, he was proclaimed Gurkhan by his followers and adopted the regnal name "Emperor Tianyou" (天祐皇帝). He established his authority over Almaliq and Qayaliq (near Taldıqorğan). To the west was the disorganized Kara-Khanid Khanate that had split into two. The Eastern Karakanid ruler of Balasaghun, Ibrāhīm II b. Ahmad, invited him to help fight the Karluks and Kankalis, and in 1134 Dashi took the opportunity to depose him, and according to Persian historian Ata-Malik Juvayni, "ascended a throne that had cost him nothing." He made Balasaghun his new capital and took over 16,000 Khitans that had served the old ruler. He spread his power over Zhetysu (modern-day eastern Kazakhstan). He sent two armies east to attack the Jurchens, which failed. He gained control over what is now Xinjiang. In May 1137 he defeated a Western Karakhanid ruler at Khujand and then spent several years consolidating his power in the Ferghana valley and Tashkent, thereby expanding his empire to the west and south.

Battle of Qatwan
The Western Karakhanids were then vassal of the Seljuks, and Mahmud appealed to the Seljuk sultan Ahmad Sanjar for help. In 1141, Dashi, interceding in a conflict between the Karakhanids and Karluk nomads, came into direct conflict with the Seljuks. Sanjar marched his troops to meet the Kara-Khitans. At the Battle of Qatwan, however, Dashi achieved a decisive victory against the Seljuk Turks. The Seljuk army suffered a great death toll, and Sanjar barely escaped with his life, but his wife and some of his best warriors were captured. The power of the Seljuks sharply declined after the battle, and the Seljuk state collapsed into internal rebellion. The Kara-Khitans became the dominant force in Central Asia, and Khwarazm and Karakhanids became vassal states of his empire. Their empire controlled an area roughly equivalent to most of today's Xinjiang, Kyrgyzstan, Uzbekistan, Tajikistan, and southern Kazakhstan.

Death
Yelü Dashi died two years after Qatwan in 1143 as the master of much of Central Asia. At time of his death, the Qara Khitai ruled Transoxiana, Ferghana, Semirechye, the Tarim Basin, and Uyghuria. His empress Xiao Tabuyan succeeded him as regent of the dynasty.

Legacy
The dynasty Yelü established would last until its usurpation by Kuchlug followed by conquest of its domain by Genghis Khan in 1218.

His victory over the Seljuks and his amicable relations with Nestorian Christianity, which flourished under the Qara Khitai, led to his association with the legend of Prester John, a Christian king in the east who was "destined" to vanquish Islam. Bishop Otto of Freising first chronicled the story in 1145.

Family

 * Consort: Xiao Tabuyan, Empress Gantian (regent) of (Western) Liao
 * Son: Yelü Yilie, Emperor Renzong of (Western) Liao
 * Daughter: Yelü Pusuwan, Empress Chengtian (regent) of (Western) Liao