By the late tenth century the Silk Road had begun to fade. More caves would be dug and decorated, including one with sexually charged tantric murals that was built in 1267 under the Mongol Empire founded by Genghis Khan. But as new sea routes opened and faster ships were built, land caravans slipped into obsolescence. China, moreover, lost control over large portions of the Silk Road, and Islam had started its long migration over the mountains from Central Asia. By the early 11th century several of the so-called western regions (part of modern-day Xinjiang, in China's far west) had been converted to Islam, and Buddhist monks placed tens of thousands of manuscripts and paintings in a small side chamber adjoining a larger Mogao grotto.
Were the monks hiding documents for fear of an eventual Muslim invasion? Nobody knows for sure. The only certainty is that the chamber—now known as Cave 17, or the Library Cave—was sealed up, plastered over,and concealed by murals. The secret cache would remain entombed for 900 years.
The diagonal scar gouged by an ancient sand drift is still visible on the murals outside Cave 17. By the turn of the 20th century, when a Taoist priest named Wang Yuanlu became the sanctuaries' self-appointed guardian, many of the abandoned grottoes were buried in sand. In June 1900, as workers cleared away a dune, Wang found a hidden door that led to a small cave crammed with thousands of scrolls. He gave some of them to local officials, hoping to elicit a donation. All he received was an order to seal up the contents of the cave.
It would take another encounter with the West to reveal the secrets of the caves—and to sound China's patriotic alarms. Aurel Stein, a Hungarian-born scholar working for the British government in India and the British Museum, made it to Dunhuang in early 1907 using Xuanzang's seventh-century descriptions to guide him across the Taklimakan Desert. Wang refused to let the foreigner see the bundles from the Library Cave—until he heard that Stein too was a keen admirer of Xuanzang. Many of the manuscripts, it turned out, were Xuanzang's translations of the Buddhist sutras that he had brought from India.
After days of wheedling Wang and nights of removing scrolls from the cave, Stein left Dunhuang with 24 cases of manuscripts and five more filled with paintings and relics. It was one of the richest hauls in the history of archaeology—all acquired for a donation of just 130 pounds sterling. For his efforts, Stein would be knighted in England, and for-ever vilified in China.