As rebels searched the bags of the truck passengers at a checkpoint near Timbuktu, one man was trying to hide his nervousness.

Mohamed Diagayete, an owlish scholar with an eager smile, was silently praying that the rebels would not discover his laptop computer. Buried in his laptop bag was an external hard drive with a cache of thousands of valuable images and documents from Timbuktu's greatest cultural treasure: its ancient scholarly manuscripts.

Radical Islamist rebels in northern Mali have repeatedly attacked the fabled city's heritage, taking pickaxes to the tombs of local saints and smashing down a door in a 15th century mosque. They demolished several more mausoleums this week and vowed to destroy the rest, despite strong protests from UNESCO, the United Nations cultural agency.

Story continues below advertisement

With the tombs demolished, Timbuktu's most priceless remaining legacy is its vast libraries of crumbling Arabic and African manuscripts, written in ornate calligraphy over the past eight centuries, proof of a historic African intellectual tradition. Some experts consider them as significant as the Dead Sea Scrolls – and an implicit rebuke to the harsh narrow views of the Islamist radicals.

But now the manuscripts, too, could be under threat. And so a covert operation is under way to save them.

That's why Mr. Diagayete was so anxious to smuggle his hard drive out of Timbuktu. For years, he's been helping preserve the manuscripts by digitizing them. But the project was halted when the Islamists seized Timbuktu in April. A few months later, Mr. Diagayete made an undercover visit to Timbuktu and brought back as many of the digital images as he could.

The quest to save the documents rarely leaves his thoughts. "What will happen to the manuscripts?" he asks from the safety of Mali's capital, Bamako, where he fled after the fall of Timbuktu.

"I'm always asking myself thousands of questions about the manuscripts," he says. "When we lose them, we have no other copy. It's forever."

Mr. Diagayete is a researcher at the Ahmed Baba Institute, which has been digitizing the manuscripts for nearly a decade with support from foreign governments. But because of technical delays, and the huge number of manuscripts in the city (up to 700,000 by some estimates), only a tiny fraction has been copied so far.

The manuscripts, dating back to the 13th century, are evidence of ancient African and Islamist written scholarship, contradicting the myth of a purely oral tradition on the continent.

Story continues below advertisement

Many of the manuscripts are religious documents, but others are intellectual treatises on medicine, astronomy, literature, mathematics, chemistry, judicial law and philosophy. Many were brought to Timbuktu in camel caravans by scholars from Cairo, Baghdad and Persia who trekked to the city when it was one of the world's greatest centres of Islamic learning. In the Middle Ages, when Europe was stagnating, the African city had 180 religious schools and a university with 20,000 students.

Timbuktu fell into decline after Moroccan invasions and French colonization, but its ancient gold-lettered manuscripts were preserved by dozens of owners, mostly private citizens, who kept them in wooden trunks or in their own libraries.

Today, under the occupation of the radical jihadists, the manuscripts face a range of threats. Conservation experts have fled the city, so the documents could be damaged by insects, mice, sand, dust or extreme temperatures. Or the Islamist militants could decide to raise money by looting and selling the documents.

There's also a risk that the militants could simply destroy the manuscripts, since some are written by African mystics or moderate Sufis, regarded by the Islamist rebels as ideological enemies. Another threat is the planned Western-backed military campaign against the rebels, which could lead to house-to-house fighting in Timbuktu, further endangering the manuscripts.

The government-run Ahmed Baba Institute holds nearly 40,000 manuscripts in two main buildings, including a headquarters built with South African assistance in 2009. But the Islamist rebels have seized the institute, looting its computers and using its new building as a sleeping quarters.

"It's a big setback for the institute," said Susana Molins Lliteras, a researcher at a South African-based project to protect the Timbuktu manuscripts.

Story continues below advertisement

"It's very possible that things have been lost," she said. "We haven't even had a chance to research the manuscripts – we haven't scratched the surface. So if they are lost, we won't even know what is lost."

Since the rebel takeover, the private owners have scrambled to protect the manuscripts. Nobody knows exactly what they have done, but it is believed that some owners have hidden the manuscripts, buried them in the sand, or smuggled them to villages.

This, too, is dangerous, since the ancient texts can easily be damaged when they are moved. "They are very fragile," Mr. Diagayete said. "The choice is difficult: Either we lose them all or we lose part of them. Everyone is trying to find a way to protect their manuscripts."

Adama Diarra, a Malian journalist, saw three owners piling their manuscripts into 50-kilogram rice bags in April, shortly after the Islamists seized Timbuktu, apparently in an effort to move them to safer places. "The pages were falling out," he said.

Mohamed Galla Dicko, director of the Ahmed Baba Institute for 17 years before leaving the institute this year, says the threat to the manuscripts is serious. "The old pages can be damaged just by touching them," he said. "And the people who are moving them are not specialists in handling them."

While the Timbuktu manuscripts are in trouble, there is better news from another ancient Malian town, Djenne, south of the rebel-controlled territory. With help from the British Library, researchers are digitizing thousands of Djenne's historic manuscripts – some nearly 500 years old.

Story continues below advertisement

Even when fuel and electricity were rationed after the rebel advances, dedicated workers kept toiling on the project at Djenne's manuscript library. "We've saved a large number of the manuscripts," said Sophie Sarin, a Swedish hotel owner in Djenne.

The project aims to collect 200,000 images by next July. After the rebels captured northern Mali this year, Ms. Sarin travelled to London with a hard drive containing 80,000 digital images of the Djenne manuscripts. She brought them to specialists at the British Library, who were very relieved to see them, she said.