Tashkurgan has a long history as a stop on the Silk Road. Major caravan routes converged here leading to Kashgar in the north,Karghalik to the east, Badakhshan and Wakhan to the west, and Chitral and Hunza to the southwest in Gilgit Baltistan of today's Pakistan.
About 2,000 years ago, during the Han Dynasty Tashkurgan was the main centre of the Kingdom of Puli and is mentioned in the Hanshu and the later Hou Hanshu. Later it became known as Varshadeh. Mentions in the Weilüe of the Kingdom of Manli probably also refer to Tashkurgan.
Some scholars believe that a stone tower mentioned in Ptolemy and other early accounts of travel on the Silk Road refers to this spot.It said by them to have marked the midway point between Europe and China. Other scholars, however, disagree with this identification. The most plausible site is in the Alay Valley.
Many centuries later Tashkurgan became the capital of Sarikol kingdom , a kingdom of the Pamir Mountains, and later of Qiepantuo under the Persians. At the northeast corner of the town is a huge fortress known as the Princess Castle dating from the Yuan Dynasty (1279–1368 CE) and the subject of many colourful local legends. A ruined Zoroastrian temple is near the fortress.
The Buddhist monk Xuanzang passed through Tashkurgan around 649 CE, on his way to Khotan from Badakhshan, as did Song Yunaround 500 CE. When Aurel Stein passed through the town in the early twentieth century he was pleased to find that Tashkurgan matched the descriptions left by those travellers: discussing Qiepantuo, Xuanzang recorded (in Samuel Beal's translation), "This country is about 200 li in circuit; the capital rests on a great rocky crag of the mountain, and is backed by the river Śitâ. It is about 20 li in circuit."
Xuanzang's discussion of Qiepantuo in the original Chinese can be found on Wikisource here in book twelve of Great Tang Records on the Western Regions. This goes on to recount a tale which might explain the name of the Princess Castle: A Han princess on her way to mar
ry a Persian king is placed on a high rock for safety during local unrest. She becomes pregnant from a mysterious stranger, ultimately giving birth to a powerful king and founding the royal line ruling at the time of Xuanzang's visit. Stein records a version of this, current at the time of his visit, in which the princess is the daughter of the Persian king Naushīrvān.
Stein argued that, judging from the topography and remains found around Tashkurgan, the fort and associated settlements had clearly been central to the broader Sarikol area, controlling routes from the Oxus to the oases of southern Turkestan.
Xuanzang describes a substantial Buddhist site with tall towers, leading Stein to speculate as to whether the pilgrimage site dedicated to Shāh Auliya, several hundred yards to the northeast of the town site, and in use at the time of his visit, might have seen continuous but changing local use as a holy site down the centuries.