The Qirqiz (Kyrgyz), by the Chinese called Xiajiasi 黠戛斯 and later Jilijisi 吉利吉思, were a Türkic-speaking people living in the western parts of modern Mongolia, and near the upper course of the River Yennisey. Although the Qirqiz language is definitely Türkic, some people showed physical signs of Indo-Iranian ancestry. The Qirqiz were pastoral nomads, but also engaged in fishing and hunting, and some even in agriculture. Their religion was shamanic, and they prognosticated the future with the help of runic signs.
Chinese scholar identify them with peoples from the northwest that were from the Han 漢 (206 BCE-220 CE) to the Sui 隋 (581-618) periods called Likun 鬲昆, Gekun 隔昆, Jiankun 堅昆, Hugu 護骨, Jiegu 結骨, Qigu 契骨 or Gegu 紇骨. The name Qirqiz first appears in the Türkic inscriptions of the steles of the region of the River Orkhon that date from the mid-8th century. Chinese sources from the Tang period 唐 (618-907) call them Xiajiasi 黠戛斯, or Hegusi 紇扢斯. In the early 7th century the Qirgiz were vassals to the Syr Tarduš 薛延陀, a Türkish federation in the northwest. In 632 a first Chinese embassy was sent to the khan of the Qirgiz. Shibo Qu'azhan 失鉢屈阿棧 in 648 visited the court in Chang'an 長安 (modern Xi'an 西安, Shaanxi) and was appointed commander-in-chief (dudu 都督) of the area command (dudufu 都督府) of Jiankun that was subordinated to the protectorate (duhufu 都護府) of Yanran 燕然. Yet the Qirqiz soon became vassals to the Uyghur 回紇 khanate that was the successor of the mighty khanates of the Türks (Tujue 突厥).
GIn the 830s the Uyghur khanate disintegrated and was finally destroyed by the Qirqiz. For a while they occupied the area formerly controlled by the Uyghurs, north and south of the Tianshan Range 天山, but they withdrew again towards the northwest. Their western neighbours were the Qarluqs 葛邏祿, while the Tibetan kingdom of Tubo 吐蕃 was in the south. The Qirqiz played an important role as a protective power in the Western Territories after the Chinese had lost control over this region. In 845 therefore the Tang court bestowed the khan of the Qirqiz the honorific title of Zong yingxiong wu chengming kehan 宗英雄武誠明可汗 "Fathering Heroes, Martial and Sincere, Brilliant Khan".
When the Liao dynasty 遼 (907-1125) of the Khitans 契丹 took over northern China, the khans of the Qirqiz were appointed administrators of the Great Princedom (dawangfu 大王府) of the Xiajiasi 轄戛斯. Song 宋 (960-1279) sources call them Xiajiasi 黠戛司, but the people of the Song empire did not know a lot about the Qirqiz. The Jurchens 女真, founders of the Jin empire 金 (1115-1234), called them Geliqisi 紇里迄斯, and sources of the Mongol 蒙古 Yuan empire 元 (1279-1368) Jilijisi 吉利吉思. The Qing 清 (1644-1911) took over the Dzunghar 準噶爾 designation for the Qirqiz which was Burut 布魯特. From the 12th century on the Qirqiz moved more southwards, probably under the pressure of the Western Liao empire 西遼 (1124-1211) and the Mongols' western campaigns.
In the early 13th century the various tribes of the Qirqizes were headed by chieftains called inal (Chinese rendering yinan 亦難). In 1207 one of the highest leader, called Woluosi 斡羅思, declared his willingness to become a vassal of Činggis Qaɣan, but ten years later the tribe of the Tuma 吐麻 rebelled against the suzerainty of the Mongols. They were brought down by a Mongol army under Joci 朮赤, a son of Činggis Qaɣan. The Mongols thereupon divided the Qirqizes into nine parts, each of them consisting of one thousand military households. After Činggis Qaɣan's death the Qirqizes fell under the overlordship of Činggis Qaɣan's son Tolui 拖累 and his wife Sorghaghtani Beki 唆魯禾帖泥, and were thereafter vassals of Tolui's son Arigh Böke 阿里不哥. The latter became an arch-enemy of his cousin Qubilai 忽必烈, who was khan over China. Qubilai appointed Liu Haoli 李好禮 as governor (duanshiguan 斷事官) of the five Qirqiz tribes.
Their territory was divided into administrative units and was administered by registrars (jingli 經歷) and administrative clerks (zhishi 知事). Liu Haoli reduced the amount of tributes the Qirqizes had to deliver annually to the Mongol court, and revived the the military agro-colonies (tuntian 屯田) in the land of the Qirqiz. In order to use them effectfully, Chinese settlers were sent to the west that brought with them agricultural tools not known by the Qirqizes, as a people of pastoral nomads and hunters. The land of the Qirqiz became a fighting ground for the many Mongol princes that challenged the power of Qubilai's line, like Qaidu 海都, or Togh Temür 脫鐵木兒. In 1291 the Mongols established a courier route through the territory of the Qirqizes, which was a prelude to the final conquest of the Qirqiz territory by the Mongols under general Tutuha 土土哈 two years later. A lot of Qirqizes were resettled to eastern China where they founded settlements in Liaodong and Shandong.
In the 15th century the Dzunghars forced the Qirqiz to move westwards, into the Seven Rivers Area near the Balkhash Lake (in modern Kazakhstan), where they live still today. The state of Kirgizstan is named after them. They also constitute one of the National Minorities (shaoshu minzu 少數民族) in China, the Kerkezi 柯爾克孜族.