The state of Shache 莎車 (Türkic name Yarkant) was located in the area of modern Shache and Maigaiti 麥蓋提, Xinjiang. The capital was inhabited by 2,300 persons during the Former Han period 前漢 (206 BCE-8 CE). Their number increased to 16,300 persons during the Later Han period 後漢 (25-220 CE). The name Shache already appears in a geographical list in the book Yizhoushu 逸周書 (chapter Wanghui 王會). The inhabitants of Shache belonged to the Indo-Iranian people of the Sakas (Chinese transliteration Sai 塞).
During the early first century BCE Shache became subject to the Protector-general of the Western Territories (Xiyu duhu 西域督護). Under Emperor Xuan 漢宣帝 (r. 74-49), the ruling dynasty of Shache was ended, and the people asked to be ruled by a son of a Wusun 烏孫 princess, Wan-nian 萬年. Wan-nian was killed for his brutality by a younger brother of the former king, Hu-tu-zheng 呼屠徵. Hu-tu-zheng persuaded all states of the southern route of the Silk Road to rebel against the Han. The Chinese general Feng Fengshi 馮奉世 killed the rebel in 65 BCE and enthroned a new king.
In the turbulent times between the Former and Later Han periods, King Yan 延 and his son King Kang 康 were the only rulers of that region not submitting to the Xiongnu 匈奴 but staying loyally to the Han dynasty. This loyalty was rewarded, and King Kang was officially appointed King of Shache at the foundation of the Later Han dynasty. He was granted the prestigious title of King Establishing Merit and Considering Virtues (jiangong huaide wang 建功懷德王) and was appointed Grand commander-in-chief (da duwei 大都尉) of the Western Territories.
His son Xian 賢 was appointed General-in-chief (da jiangjun 大將軍). He was later also appointed Protector-general and was given an imperial seal for this position. Yet the emperor of the Han soon claimed back the seal and so incited the rebellion of King Xian. He conquered Shanshan 鄯善, Qiuci 龜茲, Guisai 嬀塞 and many other smaller states and killed their kings. He captured the ruler of Dayuan 大宛, King Yan-liu 延留.
This glorious phase of the overlordship of Shache over the Western Territories was ended in 60 CE, when the rebellious armies of Yutian 于闐 conquered Shache and killed King Xian and his son Bu-ju-zheng 不居征 and enthroned Qi-li 齊黎 as king of Shache. A decade later, Shache again became a powerful state so that general Ban Chao 班超 had to force the king of Shache into submission in 87 CE. In the following decades Shache was to became a vassal state of of Qiuci and Shule 疏勒. In 127 Shache again sent tributes to the Han court.
During the Northern Wei period 北魏 (386-534) Shache was called Qusha 渠莎 and was soon conquered by Shule.