The ancient Malian city of Timbuktu has housed for centuries thousands of manuscripts which are invaluable to the history of Africa and Islam. Several thousand of them seem to have been lost or taken away by retreating Islamist militants as French and Malian troops were advancing towards Timbuktu.

The most important collection belonged to the Ahmed Baba Institute of Higher Learning and Islamic Research which moved to this new building in 2009. Recent video footage of the library shows charred books and empty boxes. This is how it looked in May 2010 when BBC Africa journalist Manuel Toledo visited Timbuktu and took these pictures.

These 13th-Century commentaries on the Koran were among the oldest manuscripts in the library. Workers at the Ahmed Baba Institute have told the BBC that around 2,000 manuscripts may have been lost while 28,000 were taken to Bamako, Mali’s capital, after the Islamist groups took control of the city.

Many other manuscripts may have survived at the institute’s old building, as the collection was still in the process of being moved to the new facilities. The Ahmed Baba centre was established by Mali's government in 1973. The new library was built with South African support. The institute’s director is Dr Mohammed Gallah Dicko.

The centre is named after Ahmed Baba, considered Timbuktu’s greatest scholar. Several of his best known texts were written while he lived in Morocco, like this manuscript from Marrakech which dates from 1599. He died in 1627 in Timbuktu.

The manuscripts dealt with different fields of knowledge. The text with red drawings, for example, is a treatise on astronomy by Nouradine bin Mohamed Ahmed, and the manuscript on the bottom left is an 18th-Century copy of an earlier text on pharmacology. It contains recipes for traditional Sahelian remedies written next to Koranic verses.

In 2010, researchers at the institute pointed out proudly that many of the texts proved that Africa had an ancient written history, unlike what many of the continent’s colonisers had claimed. The University of Timbuktu was one of the most important academic centres in West Africa around the 15th Century and is said to have attracted thousands of scholars.

In the new building the manuscripts were being digitised before being restored - in case something went wrong and also with the hope of making them available on the internet. It was a project that was expected to take many years. It may have saved some of the contents of the missing texts as the hard disks containing the digital data were reportedly taken to Bamako.

Many of the manuscripts were acquired from Timbuktu families which had kept them for centuries. The dry climate of the region, located on the southern edge of the Sahara desert, contributed to their preservation. This is a 17th-Century copy of a biography of the Prophet Muhammad.

The long process of restoration included specialised book-binding and the making of insect-proof boxes. Researchers from the Ahmad Baba Institute also taught contemporary preservation methods to local people who did not want to sell their manuscripts to the state.

The manuscripts were written using different kinds of West African scripts, including Saharan, Sudani, Maghribi and Suqi. Once the type of script was identified, the researchers would try to establish the theme of the manuscript, its title, its author, as well as the names of the calligrapher and that of the person who commissioned it.