The Kangju 康居 were a not further identifiable people living in the area of modern Kazakhstan along the banks of River Syr Darya. The population was probably as large as 80 to 90,000 people during the 2nd century BCE and reached as much as 600,000 at the end of the 1st century CE. The Kangju were a federation of various tribes whose ruler resided in the city of Beitian 卑闐 (approximately in the region of modern Toshkent, Uzbekistan, and Shymkent, Kazakhstan). The tribesmen were pastoral nomads and migrated southwards during winter and northwards during the sommer months. News of the Kangju had reached China already during the early Han period 漢 (206 BCE-220 CE). Zhang Qian 張騫 explored the peoples living west of the Han empire and provided the Chinese court with more information about the western countries. At that time the Kangju were not a very powerful people and suffered from the control by the Xiongnu 匈奴 in the northwest and the Yuezhi 月氏 (Tokharians) in the south.
Based on Tan Qixiang 譚其驤, ed. (1995), Zhongguo lishi ditu ji 中國歷史地圖集, Vol. 2, Qin, Xihan, Donghan shiqi 秦西漢東漢時期 (Beijing: Zhongguo ditu chubanshe, 1996). Tribes and peoples in italics, states in normal letters.
When the Han armies attacked the Dayuan 大宛 in 103 BCE, the Kangju declared their support against the Chinese invaders but did not sent an army. In 56 BCE the federation of the Xiongnu fell apart, and while the southern Xiongnu submitted to the Han empire, the khan (chanyu 單于) of the Northern Xiongnu 北匈奴, Zhizhi 郅支, moved westwards and settled down in the grasslands of modern Kirgistan. The king of the Kangju asked him to take residence more south, in the territory inhabited by the Kangju. This would enable both the unite against the Wusun 烏孫 in the east that had surrendered to the Han empire. Zhizhi Khan moved to the banks of the Dulai River 都賴水 (modern Talas River) and founded the city of Zhizhi (modern Jiangbur 江布爾).
In 36 CE the Han empire mobilised its armies in the Protectorate of the Western Territories (Xiyu duhufu) and attacked Zhizhi Khan. The khan was killed, but the country of the Kangju was not incorporated into the protectorate, mainly because it was located beyond the Pamir Range and not easy to control. In the coming decades the realm of the Kangju dominated the whole plain north between the Hindukush and the Aral Sea. Only in the mid-1st century CE the kingdom of Kushana (Chinese transliteration Guishuang 貴霜) became stronger and conquered the region. During the Northern Dynasties period 北朝 (386-581) Kangju was first controlled by the Hephthalites (Chinese transliteration Yeda 嚈噠), later by the Turks 突厥. In the early 650s the region was conquered by the Tang empire 唐 (618-907), and the area command (dudufu 都督府) of Kangju was established. The seat of the commander-in-chief (dudu 都督) was the city of Samojian 薩末鞬 (also written 颯抹建, the modern Samarkand in Uzbekistan). The king of Kangju as commander-in-chief controlled the neighbouring statelets of the region, the so-called "nine barbarian families of Zhaowu" (Zhaowu jiu xing hu 昭武九姓胡). In the mid-8th century the Arabs conquered the region.
When Buddhism spread from India to the north, it also found adherents among the people of Kangju, and a lot of Central Asian monks travelling to China were Kangju, as can be seen in their "surname" of Kang 康.