Yelü Dashi

Yelü Dashi(Chinese:耶律大石;pinyin:Yēlǜ Dàshí;Wade–Giles:Yeh-Lü Ta-Shih; alternatively Chinese:耶律達實; pinyin:Yēlǜ Dáshí),courtesy nameZhongde(重德), also known by histemple nameas theEmperor Dezong of Western Liao(西遼德宗), was the founder of theWestern Liao dynasty(Qara Khitai).He initially ruled as king from 1124 to 1132, then asemperorandgurkhanfrom 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 imperialYelüclan, he fled theLiao dynastyin northern China as it was on the verge of destruction by theJurchen-ledJin dynastyand moved westward intoCentral Asiawhere he established a new empire.
There are various theories regarding his name. According to Sugiyama Masaaki,Dashi(大石) might be a borrowing from Chinese titletaishi(太師).Qidan Guo Zhisuggests was just a nickname.
Yelü Dashi was a minor member of the Liao dynasty's imperialYelü clanand an eighth generation descendant of theEmperor 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.  TheHistory of Liaodescribes him as "well-versed inKhitanand Chinese scripts, excelled in riding and archery, and had passed the highestimperial examinationin the fifth year of theTianqing 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 modernTailai County,Heilongjiang) and Xiangzhou (祥州, in modern Wanjinta Township,Nong'an County).
TheJurchens, aTunguspeople who lived north of Liao dynasty inManchuria, established theJin dynastyin 1115 and began to dominate Manchuria. The Jin dynasty formed analliancewith theSong dynastyto attack the Liao, and by 1122 the Jin had captured a large part of Liao territories, including its supreme capital ofChifeng. The Liao emperorTianzuofled west, and his uncle Prince Yelü Chun then formed the short-livedNorthern Liaoin its southern capital ofLiao Nanjing(nowBeijing). The Song forces under the command ofTong Guanattacked 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.
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 theOrkhon RiverinBulgan 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 theWestern Xiato 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 theYenisei Kyrgyzhe established a new base on theEmil Riverjust east of the current Chinese border about 1500 km west of Kedun. At about the same time, he was welcomed by the ruler of theKingdom of Qocho(about 500 km southeast of Emil near Turfan) who became his ally or vassal. In the summer of 1131 he attackedKashgar(over 1000 km east ofQocho), was soundly defeated and withdrew to Qocho. The Jurchens sent an army after him, but this failed because of the distance.
In 1132, he was proclaimedGurkhanby his followers and adopted the regnal name "Emperor Tianyou" (天祐皇帝).He established his authority overAlmaliqand Qayaliq  (nearTaldıqorğan). To the west was the disorganizedKara-Khanid Khanatethat had split into two. The Eastern Karakanid ruler ofBalasaghun, Ibrāhīm II b. Ahmad, invited him to help fight theKarluksandKankalis, and in 1134 Dashi took the opportunity to depose him, and according to Persian historianAta-Malik Juvayni, "ascended a throne that had cost him nothing."He madeBalasaghunhis new capital and took over 16,000 Khitans that had served the old ruler. He spread his power overZhetysu(modern-day eastern Kazakhstan). He sent two armies east to attack the Jurchens, which failed. He gained control over what is nowXinjiang. In May 1137 he defeated a Western Karakhanid ruler atKhujandand then spent several years consolidating his power in theFerghana valleyandTashkent, thereby expanding his empire to the west and south.
TheWestern Karakhanidswere then vassal of theSeljuks, and Mahmud appealed to the Seljuk sultanAhmad Sanjarfor 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 theBattle of Qatwan, however, Dashi achieved a decisive victory against theSeljuk 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 inCentral Asia, andKhwarazmandKarakhanidsbecame vassal states of his empire. Their empire controlled an area roughly equivalent to most of today'sXinjiang,Kyrgyzstan,Uzbekistan,Tajikistan, and southernKazakhstan.
Yelü Dashi died two years after Qatwan in 1143 as the master of much of Central Asia. At time of his death, theQara KhitairuledTransoxiana,Ferghana,Semirechye, theTarim Basin, andUyghuria. His empressXiao Tabuyansucceeded him as regent of the dynasty.
The dynasty Yelü established would last until its usurpation byKuchlugfollowed by conquest of its domain byGenghis Khanin 1218.
His victory over the Seljuks and his amicable relations withNestorian Christianity, which flourished under the Qara Khitai, led to his association with the legend ofPrester John, a Christian king in the east who was "destined" to vanquish Islam.BishopOtto of Freisingfirst chronicled the story in 1145.