Dunhuang is at the edge of Gobi desert, in the western part of modern Gansu province. This oasis town was not only an important station for the caravans of the Silk Road, but the route of the embassies coming from Central Asia and from India passed through it as well. Missionaries and pilgrims of Buddhism and other faiths took a rest or settled for a shorter or longer period here.

The town was founded as a military station by the great emperor of the Han Dinasty Wudi in 111 B. C. in order to ensure China’s western expansion and control of the trade route. A border wall flanked by watch-towers was also built to the north of the town, expanding to the west of Dunhuang as far as the Jade Gate (Yumen). The town later became a center of administration and changed its name: from 622 to the 14th century it was called Shazhou (“Town of the Sand”), but later it took back its old name. Between 786 and 848 it was under Tibetan control, while between 1038 and 1227 it belonged to the Tangut (in Chinese: Xi Xia) Empire. The importance of this site derives from the fact that the road leading to Eastern Turkestan (the modern Xinjiang province) forks here in order to bypass from the south and the north the dreadful Taklamakan desert.

By the 4th century A. D. there was a flourishing Buddhist community in Dunhuang. Travelers frequently visited Its sanctuaries before setting out on the dangerous desert route or upon arrival to give thanks for the successful traversing of the sea of sand. To the southwest of the city is the Mingsha Shan, that is the Mountain of Roaring Sand, flanked by a long wall of rocks in which a monk called Yuezun, perhaps in search of a calm place for meditation, carved the first cave in 366. This first cave was followed by many others, almost without interruption, for a thousand years, and while at first they served only as shelters for the monks, later they became decorated temples. This is how the the Cave Temples of the Thousand Buddhas (Qianfodong) originated. This complex of works of art, with its 45 thousand square meters of surviving frescoes and more than 2000 stucco statues found in 492 caves is considered as the most outstanding Buddhist art gallery in the world.

Aurel Stein arrived in March 1907 to Dunhuang, where he heard of a Turkic merchant some “vague rumours about a great hidden deposit of ancient manuscripts which was said to have been discovered accidentally some years earlier in one of the grottoes. And the assertion that some of these manuscripts were not Chinese had naturally made me still keener to ascertain certain details.”

The hidden cell had been discovered in 1900 by Wang Yuanlu, the self-appointed custodian of the Caves of the Thousand Buddhas. This simple Daoist monk considered it hist life’s task to utilize the donations collected from the believers for cleaning the sanctuaries of sand and waste, repair of the damaged frescoes and sculptures, and the commissioning of new ones. Once, while examining a crack on a fresco in a large corridor, he found a walled-up cell that was full of bundles of manuscripts from floor to ceiling. Following this discovery, he sent a sample to his regional superior who instructed him to close the cell and guard it. Therefore, Stein had to behave very cautiously in order to dispel the distrust and anxiety of Wang. A solution was offered by a fresco representing Xuanzang, the well known 7th-century Buddhist monk who traveled through Central Asia to India, from where he returned to China loaded with Buddhist sacred books. Stein told to Wang that he regarded this Chinese Buddhist pilgrim as his holy protector, and he was following his footsteps in this region. Persuaded by this explanation, Wang secretly lent Stein some Chinese manuscripts for one night. As if it were a “heavenly sign”, it turned out that “This fine rolls of paper contained Chinese versions of certain ‘Sutras’ from the Buddhist canon which the colophons declared to have been brought from India and translated by Hsan-tsang himself… Was it not ‘T’ang-sng’himself, so Chiang declared, who at the opportune moment had revealed the hiding-place of that manuscript hoard to an ignorant priest in order to prepare for me, his admirer and discipline from distant India, a fitting antiquarian reward on the westernmost confines of China proper?” After completely dispelling the mistrust of Wang, Stein was not only allowed to search through the manuscripts, but – with a promise of absolute secrecy – he could also take with him 24 cases of manuscripts as well as 5 cases of the paintings hidden between the paper bundles, in turn for the silver he offered for the restoration of the sanctuaries.

The Library Cave, as “Cave 17” is usually called today, conserved some 15 cubic meters of manuscripts and paintings. Most of them are in Chinese, some in Tibetan. However, due to the expansion of Buddhism and the meeting of cultures, there are several in different Indian, Iranian and Turkish languages. Most of the religious texts belong to Buddhism, but there are also Manichean, Nestorian Christian, Daoist and Confucian texts as well as secular documents offering a glimpse into the everyday life of the town. Contracts and last wills were also deposited here, while the administration of Dunhuang used the place as an archive, as attested by the various registrations, census records and almanacs. The earliest dated document comes from 406, and the latest from 1002. The reason for the walling up of the cell is unknown. Stein and other scholars attributed it to the Tangut expansion, while now it is connected instead with that of the first Muslim Turkish dynasty of the Karakhanids.

Found among the manuscripts was the oldest printed book in the world, the Diamond Sutra dated May 11, 868, as well as several hundred paintings on silk, canvas and paper, and embroidered votive gifts. The painted silks and canvases were temple banners. “My main care was how many of them I might hope to rescue from their dismail imprisonment,” wrote Stein.