Turk Shahis
The Turk Shahis were a dynasty of Western Turk, or mixed Turco-Hephthalite origin, that ruled from Kabul and Kapisa to Gandhara in the 7th to 9th centuries AD.
They may have been of Khalaj ethnicity. The Gandhara territory may have been bordering the Kashmir kingdom to the east. From the 560s, the Western Turks had gradually expanded southeasterward from Transoxonia, and occupied Bactria and the Hindu Kush region, forming largely independent polities. The Turk Shahis may have been a political extension of the neighbouring Western Turk Yabghus of Tokharistan. In the Hindu Kush region, they replaced the Nezak Huns – the last dynasty of Bactrian rulers with origins among the Xwn and/or Huna peoples.
The Turk Shahis arose at a time when the Sasanian Empire had already been conquered by the Rashidun Caliphate. The Turk Shahis then resisted for more than 250 years the eastward expansion of the Abbasid Caliphate, until they fell to the Persian Saffarids in the 9th century AD. The Ghaznavids then finally broke through into India after overpowering the declining subsequent Hindu Shahis and Gurjaras.
Kabulistan was the heartland of the Turk Shahi domain, which at times included Zabulistan and Gandhara.
Territorial extents
The Turks under the Western Turk ruler Tong Yabghu Qaghan crossed the Hindu-Kush and occupied Gandhara as far as the Indus River from circa 625 AD. Overall, the territory of the Turk Shahi extended from Kapisi to Gandhara, with a Turkic branch becoming independent in Zabulistan at one point. The Gandhara territory may have been bordering the Kashmir kingdom and the Kanauj kingdom to the east. The Turk Shahi capital of Gandhara, which possibly functioned as a winter capital alternating with the summer capital of Kabul, was Udabhandapura. The Korean pilgrim Hui Chao, visiting the area in 723–729 AD, mentioned that these regions were ruled by Turk kings.History
Establishment: Arab offensive and displacement of the Nezaks
The last extant Nezak ruler Ghar-ilchi was recorded as the king of Jibin by the Tang dynasty in 653 AD. He was also likely to be the unnamed ruler who was confirmed as Governor of Jibin under the newly formed Chinese Anxi Protectorate in 661 CE and would broker a peace-treaty with the Arabs, the same year. Nonetheless, in 664-665 CE, Abd al-Rahman ibn Samura launched an expedition to reconquer the territories lost during the Caliphate Wars. Kabul was occupied in 665 CE after a siege of a few months but soon revolted, only to be reoccupied after another year-long siege. These events mortally weakened the Nezaks though their ruler — not named in sources — was spared upon converting to Islam.Sometime soon, the Nezaks were replaced by the Turk Shahis, first in Zabulistan and then in Kabulistan and Gandhara. Their ethnic identity remains unclear and the name might be a misnomer. According to Hyecho, who visited the region about 50 years after the events, the first Shahi ruler of Kapisi — named Barha Tegin by Al-Biruni — was an usurper, who used to be a military commander in the service of the last Nezak King. Al-Biruni provides a rather legendary account of Barhategin's rise, extrapolating from multiple mythological motifs, and the precise circumstances surrounding the dawning of the Turk Shahis remain unclear.
Tang Protectorate and vassalage to the Tokhara Yabghus
The Turk Shahis, like the rest of the Western Turks, were nominally part of a protectorate under the Chinese Tang dynasty since circa 658 AD. The territory of the Turk Shahis was nominally partitioned into several Chinese Commanderies under administration of the Anxi Protectorate: the city of Yege east of Kabul was considered as the seat of a Chinese Commandery for the Jibin country, and named the Xiuxian Commandery, the city of Yan at the border with Gandhara was the seat of the Yuepan Commandery, Ghazni was the seat of the Tiaozhi Commandery.According to Chinese sources, in particular the chronicles of the Cefu Yuangui, the Turks in Kabul were vassals of the Yabghus of Tokharistan, who in turn swore allegiance to the Tangs. A young brother of the Tokhara Yabghu Pantu Nili — named Puluo in Chinese sources — visited the court of the Tang dynasty in Xi'an in 718 AD and gave an account of the military forces in the Tokharistan region, explaining that "two hundred and twelve kingdoms, governors and prefects" had been recognizing the authority of the Yabghus, since the time of his grandfather, that is, probably since the time of their establishment.
Conflict with the Arabs
Under Barha Tegin, the Shahis mounted a counter-offensive and repulsed the Arab forces after Abd al-Rahman ibn Samura was replaced as Governor of Sistan c.665 CE, taking back lost territory as far as the region of Arachosia and Kandahar. The capital was shifted from Kapisa to Kabul. The Arabs attempted a counter-offensive when Rabi ibn Ziyad al-Harithi assumed the governorship of Sistan in 671 CE, attacking the Turkic "Rutbil" at Bost, and driving him to al-Rukhkhaj. Rabi's successor Ubayd Allah ibn Abi Bakra continued the war upon being appointed in 673 CE, leading Rutbil to negotiate a peace treaty for both Kabul and Zabul, in which the governor of Sistan acknowledged control of these territories by Rutbil and the King of Kabul. Little more is known about the rule of Barha Tegin, but many of the early Turk Shahi coins are attributed to him.He was succeeded by his son Tegin Shah c. 680, whose regal title was "Khorasan Tegin Shah" meaning "Tegin, King of the East", probably referring to his resistance against the Umayyad caliph. His territory comprised the area from Kabulistan to Gandhara and initially included Zabulistan, which came to be ruled by Rutbil, his elder brother, who founded the dynasty of the Zunbils. Their relationship was at times antagonistic, but they fought together against Arab incursions.
The Arabs again failed to capture Kabul and Zabulistan in 683 AD: their general Abu Ubaida ibn Ziyad was imprisoned in Kabul and Governor of Sijistan Yazid ibn Ziyad was killed as he attacked the city. In 684–685, Kabul briefly comes under Arab control. In 698 Ubayd Allah ibn Abi Bakra of the Umayyad Caliphate lead an 'Army of Destruction' against the Zunbils, was defeated and was forced to offer a large tribute, give hostages including three of his sons and take an oath not to invade Zunbil again. About 700 Ibn al-Ash'ath tried again to invade with the 'Peacock Army', but after some initial progress eventually formed a peace treaty with the Turks, and turned around to lead a rebellion against the Umayyad viceroy of the east, al-Hajjaj ibn Yusuf.
Tegin Shah apparently regained complete suzerainty over Zabulistan around 710 CE. This appears from the accounts in the Chinese chronicles, which relates that the rulers of Zabulistan "subjugated themselves to Jibin ", sometime between 710 and 720 CE. During this period, it seems the Zunbils and the Turk Shahis intermittently accepted, or were forced to accept, payment of taxes to the Arabs, thereby acknowledging some form of political dependence, but resisted fiercely when the Arabs attempted to take a more direct military, political or religious control.
From 711 CE, the Turk Shahis also had to face a Muslim threat from the southeast, as the campaigns of Muhammad ibn Qasim established the Caliphal province of Sind, as far as Multan, at the gates of Punjab, which would last until 854 CE as an Ummayad and then Abbasid dependency.
Tang dynasty investiture
In 719/20 CE, the Tegin of Kabulistan and the Iltäbär of Zabulistan sent a combined embassy to Xuanzong, the Chinese Emperor of the Tang dynasty in Xi'an, to obtain confirmation of their thrones. The Chinese emperor signed an investiture decree, which was returned to the Turk rulers. The official Chinese recognition of the enthronement of Tegin Shah appears in the annals of the Tangshu:File:Tegin Shah.jpg|thumb|Portrait of the Turk Shahis ruler Tegin Shah, who received the investiture from the Tang Emperor in 719/720 CE, as "King of Jibin, Tegin of the Khalaj".
The word "Geluodazhi" in this extract, is thought to be a transliteration of the ethnonym Khalaj. Hence Tegin Shah was described as "Tegin of the Khalaj". This title also appears on his coinage in Gupta script, where he is named "hitivira kharalāča", probably meaning "Iltäbär of the Khalaj".
In 720 CE, the ruler of Zabulistan also received the title Gedaluozhi Xielifa, Xielifa being the known Chinese transcription of the Turkish "Iltäbär", hence "Iltäbär of the Khalaj". This appears in another extract from the Tangshu describing the country of Zabulistan, mentioning how Zabulistan was a vassal to the Kabul Shah around the same period, and how the Zunbil ruler, named "Shiquer", was also recognized by the Chinese court:
These two Chinese accounts tend to confirm that the Turk Shahi and Zunbil rulers were Khalaj Turks. The Korean pilgrim Hyecho accompanied the return embassy in 726 AD, and wrote an account of his travel and visit at the court of Kabul, relating that Turk kings ruled the territories of Gandhara, Kapisa and Zabulistan at the time, that they were Buddhists, and that the King of Kabul was the uncle of the ruler of Zabul.
Victory over the Arabs
In 739 CE, Tegin abdicated in favour of his son Fromo Kesaro:"Fromo Kesaro" is probable phonetic transcription of "Rome Caesar". He was apparently named in honor of "Caesar", the title of the then East Roman Emperor Leo III the Isaurian who had defeated their common enemy the Arabs during the Siege of Constantinople in 717 AD, and sent an embassy to China through Central Asia in 719 AD which probably met with the Turk Shahis. In Chinese sources "Fromo Kesaro" was aptly transcribed "Fulin Jisuo", "Fulin" being the standard Tang dynasty name for "Byzantine Empire" and Jisuo the phonetic transcription of "Caesar":
Fromo Kesaro appears to have successfully fought against the Arabs. His coinage suggests that the Arabs were defeated and forced to pay tribute to Fromo Kesaro, since Sasanian coins and coins of Arab governors were overstruck by him on the rim with the following text in the Bactrian script:
Since these coins did not come out from Fromo Kesaro's foundries, but were simply pre-existing Arab/Sasanian coins which he overstruck on the rim with his victorious legends in Bactrian, it would seem that in all likelihood the coins underwent this rather simple overstriking procedure in the field, probably during one of his victorious campaigns against the Muslims.
Fromo Kesaro's victories may have forged parts of the epic legend of the Tibetan King whose name appears to be phonetically similar: Phrom Ge-sar.