When the wind blows through the dunes around the Western Chinese city of Dunhuang – long a garrison town between the Gobi and Taklamakan Deserts – it is said to produce sounds similar to song. In 366, the itinerant monk Yuezun was wandering through the arid landscape when a fantastical sight appeared before him: a thousand buddhas, bathed in golden light. (Whether heat, exhaustion or the strange voice of the sands worked themselves on his imagination is anyone’s guess.) Awed by his vision, Yuezun took up hammer and chisel and carved a devotional space into a nearby cliff-face. It soon became a centre for religion and art: Dunhuang was situated at the confluence of two major Silk Road routes, and both departing and returning merchants made offerings. By the time the site fell into disuse in the 14th century, almost 500 temples had been carved from the cliff.

Among the hundreds of caves was a chamber that served as a storeroom for books. The Library Cave held more than 50,000 texts: religious tracts, business reports, calendars, dictionaries, government documents, shopping lists, and the oldest dated printed book in the world. A colophon at the end of the Dunhuang Diamond Sūtra scroll dates it to 868, nearly six centuries before the first Gutenberg Bible.

The Library Cave was bricked up some time in the 11th century, for unknown reasons: perhaps to keep the books safe from invaders; or perhaps, given the large number of worn and partial texts, the chamber was less a library than a tomb for books. Locals continued to worship at the shrines, but several of the the exterior walkways connecting the ancient cave entrances collapsed, and the sand that slowly filled many of the caves severely abraded their delicate murals.

At the end of the 19th century, Wang Yuanlu, a Taoist monk, took it on himself to restore the caves. He found the cache of texts in the course of his repair work, and in 1907 sold the Dunhuang Diamond Sūtra, along with more than 9000 other objects, to the Hungarian-British archaeologist Aurel Stein, who smuggled them out of the country. Earlier plans by Chinese officials to take the library's collection out of the caves for storage and scholarly analysis had been put on hold for lack of funds; in China, Stein is widely regarded as a thief. The sūtra remains in England, housed in the British Library.

The Dunhuang Diamond Sūtra is a testament to Chinese mastery in paper production – which by 868 had been refined over a number of centuries – and block-printing of both text and images. The frontispiece, which shows the Buddha flanked by heavenly beings and devotees, is intricately rendered in fine lines. Creating copies of a sūtra on the scale permitted by printing, and so spreading the Buddha’s teachings, was believed to increase the chances of a happy rebirth for oneself or one’s loved ones. The Dunhuang Diamond Sūtra’s colophon explains that it was ‘reverently made for universal free distribution by Wang Jie on behalf of his parents’.

In 2010, the British Library completed more than 1000 hours of painstaking conservation work, much of which was spent undoing the well-meaning but ill-advised interventions of earlier conservators. The subsequent digitisation of the scroll seems to have augmented its commissioner’s wish for ‘universal free distribution’, ensuring his mother and father a blissful afterlife, 1150 years after the book was created.