The Kereyids or Keraits (Chinese names Kelie 克烈, Kelieyi 克列夷, Qielie 怯烈, Qieliyi 怯里亦, Kelieyidang 客列亦愓 or Kailie 凱烈) were a nomad people roaming the northern steppe during the Liao 遼 (907-1125) and Jin periods 金 (1115-1234). They lived in the region of the rivers Tula and Orkhon. In the history Liaoshi 遼史 they are called Zubu 阻卜 or Bei Zubu 北阻卜, and sometimes also Dada 韃靼 "Tatars".
The word kereyid is derived from the Türkic word kara "black" because the skin of this people was rated as rather dark. Chinese sources mentioned the tribal names Zhi'erjin 只兒斤, Dong Heyidang 董合亦愓 (or Woluan Dong Heyidang 斡欒董合亦愓), Sa Heyidang 撒合亦愓, Tubiegan 禿別干 (or Tuman Tuboyi 土滿土伯夷) and Alebadang 阿勒巴愓.
The question whether the proper Kereyids were a Türkish people or a Mongolian people is not yet resolved. Some scholars are of the opinion that they were a side tribe of the Qirqiz, while some think that they are Uyghurs remaining after the disintegration of the Uyghur khanate. Supporters of the Mongol theory believe that they were descendants of the nine Tatar tribes. In fact, Yuan period people regarded the Kereyid as Mongols, like Tao Zongyi 陶宗儀 (Nancun chuogenglu 南村輟耕錄), who called them one of the seventy-two tribes of the Mongol federation, but they were classified as semuren 色目人, i.e. non-Monglian peoples of central Asian origin, like the Naimans, the Önggüds, or the Uyghurs.
The Kereyids were vassals to the Liao empire and their chieftains were appointed imperial princes (dawang 大王), grand commanders (taishi 太師), and irkin ("chieftains", Chinese rendering yilijin 夷離堇) of their tribes. The Liao court controlled them by the Northwestern Bandit Suppression Commission (xibei zhaotaosi 西北招討司) whose administrative seat was in Zhenzhou 鎮州 (modern Bulgan Province in Mongolia).
Some transmitted names of Kereyid chieftains, like Johanan or Marcus who delivered tributes to the Liao court in 1081 and 1089, show that the Kereyids were adherents of Nestorianism, a Central Asian branch of Christianity. Marcus' titles was Beilu Khan 盃祿汗. In 1092 he rebelled against the domination by the Liao but was finally defeated in 1100 and executed as a rebel.
His son Hu-er-zha-hu-si Bei-lu Khan 忽兒札胡思盃祿汗 assembled the Kereyid forces and victoriously battled against the Merkits and Tatars. He established his seat of government in the ancient Uyghur capital and entrusted his brothers and sons of the various parts of his realm. His oldest son Toghril (Chinese rendering Tuoli 脫里 or Tuowolin 脫斡鄰) suceeded as the highest leader of the Kereyids and killed all his brother to prevent an usurpation, yet his uncle Jurhan 菊兒罕 rebelled and forced him to flee to the Mongol tribe of the Qiyan 乞顔.
The Mongol chieftain Yesügai 也速該 supported Tuoli to gain back his throne, but he had to swear alliance to the Mongols. Toghril's younger brother Ye-li-ke-he-la 也力可合剌 rose weapons against his brother with the support of the Naimans under Yinanchi Khan 亦難赤汗. After a long odyssey through the land of the Western Xia 西夏 (1038-1227) and Uyghur communities Tuoli again won the support of his allies, the Mongols, and again became the leader of the Kereyids. At that time Yesügai's son Temüjin had become the khan of the Mongols and had adopted the title of Chinggis Khan. Tuoli therefore was treated with great respect, and the Kereyids became part of the Mongol federation.
In 1196 Tuoli supported the Jin empire in a punitive expedition against the Tatars under the command of Wanyan Xiang 完顔襄. For his successful participation in the war Tuoli was bestowed the title of prince, in addition to his title as khan of the Kereyids, and was therefore known as "Royal Khan" (wanghan 王罕). He played an important role in Chinggis' campaigns against the Naimans and the Mongol tribe of the Taichiwu 泰赤烏. Chinggis Khan therefore bestowed to him the title of "grand khan" (yekehan).
Envious of Chinggis' military successes, Toghril Khan rose in rebellion in 1203. He defeated the Great Khan at the battle of Helan zhenshatuo, and Chinggis had to withdraw to the River Banzhuni. Toghril Khan was overconfident by his unexpected victory and feasted his troops instead of preparing for the next round. Chinggis Khan defeated him and dissolved the people of the Kereyids by distributing them to the various military units of the Mongol federation. Toghril Khan fled to the Naimans where he was killed. His son Yi-la-he Sang-kun 亦剌合桑昆 sought refuge in the Uyghur town of Kuča, where he also was killed.
In Western narrations about Central Asia Toghril Khan was often identifed with the legendary Prester John, a Christian king priest reigning far in the east.
Among the ruling house of the Kereyids, a lot of women became spouses of Mongol rulers. Toghril Khan, for instance, had a younger brother called Zha-a-gan-bo 札阿紺孛 whose daughter Sorghaghtani Beki 唆魯禾帖泥 became the wife of Chinggis' young son Tolui 拖累 and eventually became the mother of the powerful Mongol leaders Möngke, Khubilai, Hülegü and Arigh Böke. The Kereyids survived as a people and became integral parts of the nations of the Oirats, the Ordos and Chahar.