Ghar-ilchi

Ghar-ilchi (Chinese: 曷撷支 Hexiezhi, also transliterated as Ko-chieh-chih, 653-661 CE) was, according to Chinese and Arab sources, a local king of Kapisi and the twelfth and last known ruler of the Nezak Huns. Ghar-ilchi may have been the last member of a local "Khingal dynasty" founded by Khingila, the Alchon Hun ruler.

Chinese confirmation
In the Chinese annals of 658 CE Ghar-ilchi appears as "Hexiezhi" (Chinese: 曷撷支, reconstructed from Old Chinese: *γarγär-tśiě < *ghar-ilči), reconstructed as the Turkic "Ghar-ilchi" (*Qarγïlacï, 653-c.665 CE), 12th king of his dynasty from the founder "Xinnie" (馨孽, reconstructed from Old Chinese: *xäŋ-ŋär < *henger < Khingar/ Khingal):

"In the third year of the Xianqing reign [658 CE], when [Tang envoys] investigated the customs of this state, people said: "From Xinnie, the founder of the royal house, up to the present [King] Hexiezi, the throne has been passed from father to son, [and by now] there have been twelve generations. In the same year, the city was established as Xiuxian Area Command"

- Old Book of Tang, 198.

Ghar-ilchi was formally installed as king of Jibin (former Kapisi/ Kabulistan) by the Chinese Tang dynasty emperor in 653 CE, and again as Governor of Jibin under the newly formed Chinese Anxi Protectorate, the "Protectorate of the Western Regions", in 661 CE.

Arab invasion (665 CE)
In 665 CE, general Abd al-Rahman ibn Samura launched an expedition to Arachosia and Zabulistan, capturing Bost and other cities. Kabul was occupied in 665 CE after a siege of a few months. Kabul soon revolted but was reoccupied after a month-long siege. Abd al-Rahman's capture and plunder of Kabul mortally weakened the rule of Ghar-ilchi. Ghar-ilchi, following his defeat, apparently was spared his life upon converting to Islam.

The powerful Turkic prince Barha Tegin took this opportunity to capture Kabul, and, according to the 726 CE account of the Korean monk Hyecho who visited the region, the ruler of Kabul (Kapisa), probably Ghar-ilchi, was eventually killed by the Turkic prince:

"From Kashmir I travelled further northwest. After one month's journey across the mountains I arrived at the country of Gandhara. The king and military personnel are all Turks. The natives are Hu people; there are Brahmins. The country was formerly under the influence of the king of Kapisa. A-yeh (阿耶), the Turkish prince, took a defeated calvalry and allied himself to the king of Kapisa. Later, when the Turkish force was strong, the prince assassinated the king of Kapisa and declared himself king. Thereafter, the territory from this country to the north was all ruled by the Turkish king, who also resided in the country."

Rise of the Turk Shahis (665-666 CE)
Ghar-ilchi was succeeded by Barha Tegin, who took the throne in 665-666 CE and founded the dynasty of the Turk Shahis.