[12] 10th-century Arab historian Al-Masudi listed two "Khagan of Khagans" of the Karluk horde:[25] Sanah, a possible rendition of Ashina (compare Śaya (also by al-Masudi), Aś(i)nas (al-Tabari), Ānsa (Hudud al-'Alam), and Śaba (Ibn Khordadbeh)[26]), and Afrasiab,[27] whom 11th-century Karakhanid scholar Mahmud al-Kashgari identified with Turkic king Alp Er Tunga, the legendary progenitor of the Karakhanid ruling dynasty.
The Karluks converted to Nestorian Christianity at the end of the 8th century CE, about 15 years after they established themselves in the Semerich'e region.
[42] By the mid-9th century, the Karluk confederation had gained control of the sacred lands of the Western Türks after the destruction of the Uyghur Khaganate by the Old Kirghiz.
The domain of the Karluks reached as far north as the Irtysh and the Kimek confederation, with encampments extending to the Chi and Ili rivers, where the Chigil and Tukshi tribes lived, and east to the Ferghana valley and beyond.
In the late 9th century the Samanids marched into the steppes and captured Taraz, one of the headquarters of the Karluk khagan, and a large church was transformed into a mosque.
During the 9th century, the Karluk confederation (including three chief tribes: the Bulaq (Mouluo 謀落 / Moula 謀剌), Taşlïk (Tashili 踏實力), and Sebek (Suofu 娑匐)[note 2], along with Chigils, Charuks, Barskhans, Khalajes, Azkishi and Tuhsis[47] (the last three being possibly remnants of Türgesh[48][49][50]) and the Yaghma, possible descendants of the Toquz Oghuz, joined forces and formed the first Karluk-Karakhanid khaganate.
[51] The rulers of the Karakhanids were likely to be from the Chigil and Yaghma tribes – the Eastern Khagan bore the title Arslan Qara Khaqan (Arslan "lion" was the totem of the Chigil) and the Western Khagan the title Bughra Qara Khaqan (Bughra "male camel" was the totem of the Yaghma).
The names of animals were a regular element in the Turkic titles of the Karakhanids: thus Aslan (lion), Bughra (camel), Toghan (falcon), Böri (wolf), and Toghrul or Toghrïl (a bird of prey).
In the mid-10th century the Kara-Khanids converted to Islam and adopted Muslim names and honorifics, but retained Turkic regnal titles such as Khan, Khagan, Ilek (Ilig) and Tegin.
After conversion, he obtained a fatwa which permitted him in effect to kill his presumably-still-pagan father, after which he conquered Kashgar (of the old Shule Kingdom).
The dynasty's original domains of Zhetysu and Kasgar and their khans retained an implicit seniority over those who ruled in Transoxiana and Fergana.
[12] The four sons of Ali (Ahmad, Nasr, Mansur, Muhammad) each held their own independent appanage within the Karakhanid state.
In 1017–1018, the Karakhanids repelled an attack by a large mass of nomadic Turkic tribes in what was described in Muslim sources as a great victory.
[56] Around the same time, the Kara-Khanid ruler Ilig Khan reached an agreement with Mahmud of Ghazni, in which they agreed to partition former Samanid territory along the Oxus river.
[60] Muslim accounts tell the tale of the four imams from Mada'in city (possibly now in Iraq) who travelled to help Yusuf Qadir Khan, the Qarakhanid leader, in his conquest of Khotan, Yarkend, and Kashgar.
In 1041, another son of Nasr b. Ali, Muhammad 'Ayn ad-Dawlah (reigned 1041–52) took over the administration of the western branch of the family that eventually led to a formal separation of the Khara-Khanid Khanate.
Ibrahim Tamghach Khan was considered by Muslim historians as a great ruler, and he brought some stability to the Western Karakhanids by limiting the appanage system that caused much of the internal strife in the Kara-Khanid Khanate.
In 1089, during the reign of Ibrahim's grandson Ahmad b. Khidr, the Seljuks entered and took control of Samarkand, together with the domains belonging to the Western Khanate.
At the beginning of the 12th century the Eastern Khanate invaded Transoxiana and briefly occupied the Seljuk town of Termez.
[68] In 1141 Qara Khitai became the dominant force in the region after they dealt a devastating blow to the Seljuk Sultan Ahmad Sanjar and the Kara-Khanids at the Battle of Qatwan near Samarkand.
The Qara Khitai themselves stayed at Zhetysu near Balasagun, and allowed some of the Karakhanids to continue to rule as their tax collectors in Samarkand and Kashgar.
While the Qara Khitai were Buddhists ruling over a largely Muslim population, they were considered fair-minded rulers whose reign was marked by religious tolerance.
Kashgar became a Nestorian metropolitan see and Christian gravestones in the Chu River Valley appeared beginning in this period.
[68] However, Kuchlug, a Naiman who usurped the throne of the Qara Khitai dynasty, instituted anti-Islamic policies on the local populations under his rule.
[76] The takeover by the Karakhanids did not change the essentially Iranian character of Central Asia, though it set into motion a demographic and ethnolinguistic shift.
Some of the buildings constructed by the Karakhanids still survive today, including the Kalyan minaret built by Mohammad Arslan Khan beside the main mosque in Bukhara, and three mausolea in Uzgend.
[2] During the excavations of the citadel of Samarkand, the ruins of the palace of the Karakhanid ruler Ibrahim ibn Hussein (1178–1202) were found.
The Karluk-Uyghur dialect spoken by the nomadic tribes and Turkified sedentary populations under Kara-Khanid rule formed two major branches of the Turkic language family, the Chagatay and the Kypchak.
The Kara-Khanid cultural model that combined nomadic Turkic culture with Islamic, sedentary institutions spread east into former Kara-Khoja and Tangut territories and west and south into the subcontinent, Khorasan (Turkmenistan, Afghanistan, and Northern Iran), Golden Horde territories (Tataristan), and Turkey.
There are four surviving copies of the Quran translations found in various collections and a Middle Turkic excerpt of Al-Fatiha, which supposedly belong to the Kara-Khanid period.