As a consequence of the Han–Xiongnu War spanning from 133 BC to 89 AD, the Tarim Basin region of Xinjiang in Northwest China, including the Saka-founded oasis city-state of Khotan and Kashgar, fell under Han Chinese influence, beginning with the reign of Emperor Wu (r. 141-87 BC) of the Han Dynasty.
Much like the neighboring people of the Kingdom of Khotan, people of Kashgar, the capital of the Shule Kingdom, spoke Saka, one of the Eastern Iranian languages.
As noted by the Greek historian Herodotus, the contemporary Persians labelled all Scythians as the Saka.
Indeed, modern scholarly consensus is that the Saka language, ancestor to the Pamir languages in northern India and Khotanese in Xinjiang, China belongs to the Scythian languages.

During China's Tang dynasty (618-907 AD), the region once again came under Chinese suzerainty with the campaigns of conquest by Emperor Taizong of Tang (r. 626-649).
From the late 8th to 9th centuries, the region changed hands between the Chinese Tang Empire and the rival Tibetan Empire.
By the early 11th century the region fell to the Muslim Turkic peoples of the Kara-Khanid Khanate, which led to both the Turkification of the region as well as its conversion from Buddhism to Islam.

Suggestive evidence of Khotan's early link to India are minted coins from Khotan dated to the 3rd century bearing dual inscriptions in Chinese and Gandhari Prakrit in the Kharosthi script.
Although Prakrit was the administrative language of nearby Shanshan, 3rd-century documents from that kingdom record the title hinajha (i.e. "generalissimo") for the king of Khotan, Vij'ida-simha, a distinctively Iranian-based word equivalent to the Sanskrit title senapati, yet nearly identical to the Khotanese Saka hīnāysa attested in contemporary documents.
This along with the fact that the king's recorded regnal periods were given in Khotanese as kṣuṇa, "implies an established connection between the Iranian inhabitants and the royal power", according to the late Professor of Iranian Studies Ronald E. Emmerick (d. 2001).
He contended that Khotanese-Saka-language royal rescripts of Khotan dated to the 10th century "makes it likely that the ruler of Khotan was a speaker of Iranian."
Furthermore, he elaborated on the early name of Khotan:
The name of Khotan is attested in a number of spellings, of which the oldest form is hvatana, in texts of approximately the 7th to the 10th century AD written in an Iranian language itself called hvatana by the writers.
The same name is attested also in two closely related Iranian dialects, Sogdian and Tumshuq...Attempts have accordingly been made to explain it as Iranian, and this is of some importance historically.
My own preference is for an explanation connecting it semantically with the name Saka, for the Iranian inhabitants of Khotan...
In Northwest China, Khotanese-Saka-language documents, ranging from medical texts to Buddhist literature, have been found primarily in Khotan and Tumshuq (northeast of Kashgar).
They largely predate the arrival of Islam to the region under the Turkic Kara-Khanids.
Similar documents in the Khotanese-Saka language were found in Dunhuang dating mostly to the 10th century.
As a consequence of the Han–Xiongnu War spanning from 133 BC to 89 AD, the Tarim Basin region of Xinjiang in Northwest China, including the Saka-founded oasis city-state of Khotan and Kashgar, fell under Han Chinese influence, beginning with the reign of Emperor Wu (r. 141-87 BC) of the Han Dynasty. Much like the neighboring people of the Kingdom of Khotan, people of Kashgar, the capital of the Shule Kingdom, spoke Saka, one of the Eastern Iranian languages. As noted by the Greek historian Herodotus, the contemporary Persians labelled all Scythians as the Saka. Indeed, modern scholarly consensus is that the Saka language, ancestor to the Pamir languages in northern India and Khotanese in Xinjiang, China belongs to the Scythian languages.
During China's Tang dynasty (618-907 AD), the region once again came under Chinese suzerainty with the campaigns of conquest by Emperor Taizong of Tang (r. 626-649). From the late 8th to 9th centuries, the region changed hands between the Chinese Tang Empire and the rival Tibetan Empire. By the early 11th century the region fell to the Muslim Turkic peoples of the Kara-Khanid Khanate, which led to both the Turkification of the region as well as its conversion from Buddhism to Islam.
Suggestive evidence of Khotan's early link to India are minted coins from Khotan dated to the 3rd century bearing dual inscriptions in Chinese and Gandhari Prakrit in the Kharosthi script. Although Prakrit was the administrative language of nearby Shanshan, 3rd-century documents from that kingdom record the title hinajha (i.e. "generalissimo") for the king of Khotan, Vij'ida-simha, a distinctively Iranian-based word equivalent to the Sanskrit title senapati, yet nearly identical to the Khotanese Saka hīnāysa attested in contemporary documents. This along with the fact that the king's recorded regnal periods were given in Khotanese as kṣuṇa, "implies an established connection between the Iranian inhabitants and the royal power", according to the late Professor of Iranian Studies Ronald E. Emmerick (d. 2001). He contended that Khotanese-Saka-language royal rescripts of Khotan dated to the 10th century "makes it likely that the ruler of Khotan was a speaker of Iranian." Furthermore, he elaborated on the early name of Khotan:
The name of Khotan is attested in a number of spellings, of which the oldest form is hvatana, in texts of approximately the 7th to the 10th century AD written in an Iranian language itself called hvatana by the writers. The same name is attested also in two closely related Iranian dialects, Sogdian and Tumshuq...Attempts have accordingly been made to explain it as Iranian, and this is of some importance historically. My own preference is for an explanation connecting it semantically with the name Saka, for the Iranian inhabitants of Khotan...
In Northwest China, Khotanese-Saka-language documents, ranging from medical texts to Buddhist literature, have been found primarily in Khotan and Tumshuq (northeast of Kashgar). They largely predate the arrival of Islam to the region under the Turkic Kara-Khanids. Similar documents in the Khotanese-Saka language were found in Dunhuang dating mostly to the 10th century.
Tarim Basin