French and Malian soldiers regained control of the ancient city of Timbuktu on Monday, much to the joy of Timbuktu residents.

But as the Islamist rebels who had taken it over fled, they torched a library that contained thousands of manuscripts from the Middle Ages.

Timbuktu, which is on the U.N.-designated World Heritage List, was a seat of Islamic learning for centuries, and its Ahmed Baba library, which was constructed in 2010, was home to 20,000 manuscripts dating back as early as the year 1204. It's still not known how many of the documents were destroyed.

Michael Covitt, chairman of the Malian Manuscript Foundation, called the arson a “desecration to humanity" in an interview with the Associated Press.

Time magazine's Vivienne Walt reports that some experts on the ground in Mali say many of the manuscripts were saved before the Islamists' pillage:

Realizing that the documents might be prime targets for pillaging or vindictive attacks from Islamic extremists, staff left behind just a small portion of them, perhaps out of haste, but also to conceal the fact that the center had been deliberately emptied.

“The documents which had been there are safe, they were not burned,” Mahmoud Zouber, Mali’s presidential aide on Islamic affairs, told Time, “They were put in a very safe place.”

Other experts confirmed that while there were "a few items" in the Ahmed Baba library, the rest were protected in an undisclosed hiding place.

Here's a look at why the world is so worked up over the documents and what it might mean if they were destroyed:

According to Walt, the library contained hundreds of thousands of pages, some of which had gold illumination, astrological charts and sophisticated mathematical formulas. The manuscripts cover subjects including science, astrology, medicine, theology, grammar and geography, according to the AP.

They are written in Arabic script using both the Arabic language and African languages -- a testament to Timbuktu's melting pot history. Over centuries, the city established itself as a major point on a caravan trail, bringing together Africans, Berbers, Arabs and the nomadic Tuareg people for trade.

Manuscripts were imported to Timbuktu from North Africa and Egypt, and scholars would copy them to add to their own libraries. Ahmed Baba, for whom the library is named, was a 16th-century Timbuktu scholar who had a personal library of more than 1600 books -- and his was one of the smaller collections in the region, according to the Ahmed Baba Institute.

Timbuktu began its intellectual decline with the Moroccan invasion in the 16th century, but ancient letters and books continued to be preserved in private homes.

Several years ago, residents of Timbuktu ramped up the construction of libraries and the preservation of ancient books in hopes of luring back history-loving tourists whose visits had become more rare because of attacks by Islamists in the region. In 2010, the Washington Post's Karin Brulliard wrote:

Early this year, archivists and curators trained by South Africa will take up residence at the Ahmed Baba Institute's new building. The 30,000-volume collection -- complete with a 17th-century Koran written on the skin of a gazelle -- will move into its climate-controlled rooms.

Some of the documents were centuries-old letters, kept in trunks and bookcases by Malians who inherited them from ancestors.

"What I like most is the correspondence," Mohamed M. Moure, director of the Mamma Haidara Library, told the Post, referring to antique letters. "They speak of walking to Bamako, or to Mecca . . . mysterious things."

When Islamic rebels took over the area last year, they warned library curators that they considered the documents heresy and approved of only Islamic texts.

“I’m proud of the documents I own because they contain many sciences,” Moussa Ag Hamta, owner of a private library, told Magharebia. “However, the takeover of the city by the extremist Islamic groups has put an end to the arrival of European tourists and made me hide these documents lest I should be forced to destroy or turn them in to them.”