There are many records on the origin of the Kazak ethnic minority in Chinese history. In the more than 500 years since Zhang Qian of the Western Han Dynasty (206 B.C.-A.D. 25) went as a special envoy to Wusun in 119 B.C., the inhabitants of the Ili River valley and round the Issyk Kul were mainly Wusun people and part of the Saizhong and Yueshi ethnic people, the forefathers of the Kazaks. As early as the reign of Emperor Wu Di (140-88 B.C.) of the Western Han Dynasty, Wusun established tributary relations of alliance with the Han court through the marriage of Xijun and Xieyou princesses and woman official Feng Liao with the Wusun King of Kunmo and senior generals. In the mid-sixth century, the Turkomans founded a Turkic khanate in the Altay Mountains. As a result, they mixed with the Wusun people, and the forefathers of the Kazaks later mixed with the nomadic or semi-nomadic Uighurs, Geluolus, Qidans (Khitans), Kelies, Naimans and Mongols of the Kipchak and Jagatai khanates. The fact that some of the Kazak tribes still retained the names of Wusun, Kelie and Naiman into later centuries sufficiently proves that the Kazak ethnic minority is an old ethnic group in China.
In the early 13th century, as Genghis Khan marched westward, the Wusun, Kelie and Naiman tribes had to move likewise. Part of the Kipchak, Jagatai and Wuokuotai khanates of the Mongol Empire were Kazak pastures. In the 1460s, some of the herdsmen in the lower reaches of the Syr-Darya, under the leadership of Jilai and Zanibek, returned to the Chuhe River valley south of Lake Balkhash. As they went eastward to escape the rule of the Ozbek Khanate, they were named "Kazak," meaning "refugees" or "runaways." They then mixed with southward-moving Ozbeks and the settled Mongols of the Jagatai Khanate. As the population grew, they extended their pastures to northwest of Lake Balkhash, the Chu River valley and to Tashkent, Andizan and Samarkand in Central Asia, gradually evolving into the Kazak ethnic group.
From the mid-18th century, Tsarist Russia began to invade Central Asia and eat up Kazak grasslands and areas east and south of Lake Balkhash -- part of China's territory. After the mid-19th century, owing to aggression by the Tsar, the Middle and Little hordes and the western branch of the Great Horde were cut off from China. Russian Cossacks infiltrated the area, driving the Kazaks into the deserts where men and animals could hardly survive. From 1864 to 1883, the Tsarist government compelled the Qing court to sign a number of unequal treaties, forcing the principle of "people go with the land" on the "Tacheng Protocol on the Delimitation of Sino-Russian Boundary." This met with strong opposition from the local minority nationalities. Many Mongolians, Kazaks and Kirgiz migrated back to Chinese-controlled territory. Twelve Kazak Kelie clans grazing near Zhaysang Lake moved their animals south of the Altay Mountains in 1864. More than 3,000 families of the Kazak Heizai clan moved to Ili and Bortala in 1883. Many others followed suit after the delimitation of the border.
The Ili Uprising during the Revolution of 1911 overthrew Qing rule in Xinjiang. However, it did not shake the foundation of feudal system, as warlords Yang Zengxin, Jin Shuren and Sheng Shicai gained control of the region. The Chinese Communist Party began to carry out revolutionary activities among the Kazaks in 1933. Fearful that their feudal privileges might be encroached upon, the feudal rulers within the ethnic group boycotted the establishment of schools and the development of farming, and other economic and cultural undertakings. Under warlord Sheng Shicai's rule, some Kazaks had to flee their homes, and others, because of threats and cheating by chieftains, moved to Gansu and Qinghai provinces from 1936 to 1939. There, they were plundered and massacred by warlord Ma Bufang. Ma also sowed dissension among the Kazaks, Mongolians and Tibetans, and instigated them to fight each other. As a result, the Kazaks launched an uprising in Golmud in 1939. Those in Gansu and Qinghai had to lead a vagrant life until China national liberation in 1949.