Correction: An earlier version of this article incorrectly said that the participants described their roles for the first time to The Washington Post. Some participants had previously described portions of the operation to other media, including the New Republic. This version has been corrected.

Alkamiss Cisse (L) and Abdoulaye Cisse (R) -- no relation -- work inside the Ahmed Baba Institute amongst emptied boxes and burned manuscripts on April 27, 2013 in Timbuktu. (Sudarsan Raghavan/THE WASHINGTON POST)

It was 7 o’clock on a hot night in August, and Hassine Traore was nervous. Behind him were 10 donkeys, each strapped with two large rice bags filled with ancient manuscripts. The bags were covered in plastic to shield them from a light rain.

Radical Islamists had entered Timbuktu four months earlier, and they had set about destroying everything they deemed a sin.

They had demolished the tombs of Sufi saints. They had beaten up women for not covering their faces and flogged men for smoking or drinking. They most certainly would have burned the manuscripts — nearly 300,000 pages on a variety of subjects, including the teachings of Islam, law, medicine, mathematics and astronomy — housed in public and private libraries across the city.

The scholarly documents depicted Islam as a historically moderate and intellectual religion and were considered cultural treasures by Western institutions — reasons enough for the ultraconservative jihadists to destroy them.

But a secret operation had been set in motion within weeks of the jihadist takeover. It included donkeys, safe houses and smugglers, all deployed to protect the manuscripts by sneaking them out of town.

Rescuing ancient documents in Mali

This is the story of how nearly all the documents were saved, based on interviews with an unlikely cast of characters who detailed their roles for the first time. They included Traore, a 30-year-old part-time janitor, and his grandfather, a guard.

“We knew that if we attracted any attention, the Islamists would arrest us,” Traore recalled.

The New York-based Ford Foundation, the German and Dutch governments, and an Islamic center in Dubai provided most of the funds for the operation, which cost about $1 million.

“We took a big risk to save our heritage,” said Abdel Kader Haidara, a prominent preservationist who once loaned 16th- and 18th-century manuscripts from his family’s private collection to the Library of Congress. “This is not only the city’s heritage, it is the heritage of all humanity.”

The jihadists who took control of Timbuktu in April 2012 quickly chose as their headquarters the Ahmed Baba Institute, a state-run library and research center named after a 17th-century Timbuktu scholar. The center, painted in tan and pink hues, was built in 2009 to replace an older library with the same name in another part of the city.

The militants kicked out the employees and scrawled the name of their organization on a wall in Arabic: “Ansar al-Dine,” or “Defenders of the Faith.”

The jihadists, along with fighters from al-Qaeda’s affiliate in West and North Africa, had piggybacked on a Tuareg separatist rebellion that had taken advantage of a military coup in March to overrun the north. Within weeks, the radicals pushed out the Tuareg rebels and asserted control over Timbuktu and other cities in the north.

In the 15th and 16th centuries, Timbuktu was a center of Islamic culture under several African empires. It had a university and many Islamic schools that attracted scholars and students from Cairo, Baghdad and other corners of the Middle East. Some brought along sacred Muslim texts. Others produced several hundred thousand manuscripts, handwritten in Arabic and African languages, sometimes in gold lettering.

The jihadists initially appeared not to know the value of the manuscripts kept in Timbuktu — or didn’t seem to care. But after local television reports about the manuscripts, some Islamists, clutching guns, came by the old Ahmed Baba Institute and asked the employees whether any documents were inside.

“We told them the center was empty and that all the manuscripts had been transferred to the new center,” said Abba al-Hadi, the 72-year-old guard and Traore’s grandfather, who had the keys to the place.

But in reality, most of the institute’s manuscripts, about 24,500 pages, were inside. The workers knew that it was only a matter of time before the militants would force their way in.

“The Islamists were destroying everything. We knew that once they heard of the manuscripts’ importance to the world, they would destroy them,” said Alkamiss Cisse, who worked in the restoration department of the institute.

‘We had to move fast’

The director of the Ahmed Baba Institute was worried. As a government official, Abdoulkadri Maiga knew that the jihadists would target him. So he fled to Bamako, the capital. By June, his employees in Timbuktu had informed him of the threat to the manuscripts.

Even before they contacted him, Maiga had begun to meet with private collectors from Timbuktu, including Haidara, who also had fled to Bamako to find a way to save the manuscripts. “We didn’t know if the Islamists one day would take the manuscripts hostage,” Maiga recalled. “We had to move fast.”

There was another concern: The rainy season was nearing, and it was time for annual repairs to the roof of the old center to protect the manuscripts from dampness. That was no longer possible because it could draw the attention of the jihadists.

After hearing from his employees, Maiga sent a reconnaissance mission to Timbuktu. The group returned to Bamako with the computer hard drive containing the institute’s records of the manuscripts.

In late July, Maiga sent a second mission to Timbuktu. The goal was to take out some of the manuscripts, to test whether it was possible to evade the Islamists.

During the day, members of the team stayed with relatives and friends and never stepped out. At night, they worked in the old center, putting as many manuscripts as they could into two metal trunks. Such boxes were widely used by people to pack clothes and would not attract attention. The team placed the two trunks in a truck and drove about 600 miles to Bamako without incident.

But tens of thousands of pages still needed to be sneaked out. It could take weeks or months if they took them one or two boxes at a time, increasing the chances of being caught. Maiga needed a different solution, and so he turned to Haidara, the collector, for help.

‘Manuscripts were in danger’

From the moment the Islamists seized Timbuktu, Haidara, too, had been seeking a way to save the manuscripts.

His family’s collection was housed in a private library, Mamma Haidara, named after his father. It was one of the city’s largest private libraries, its collection accumulated over the past 400 years by his ancestors. The oldest document was a 10th-century manuscript on Islamic law.

This was not the first time that his family and other private collectors had to find a way to protect their manuscripts. Whenever foreigners invaded Timbuktu, such as the Moroccans in the 16th century or the French colonialists in the 19th century, people hid the manuscripts in caves and secret rooms or transferred them out of the city.

For more than 60 years under French rule, Haidara’s family had buried their manuscripts in deep pits and in metal trunks, fearing that the documents would be seized and sent to Europe. It wasn’t until 1960, when Mali became independent again, that his family could freely show them again.

Now, it was time to hide the manuscripts once more. Haidara bought several hundred metal trunks, which he and his employees packed with manuscripts and began to secretly transfer at night. By May, his team had moved tens of thousands of pages of manuscripts from the libraries to safe houses elsewhere in Timbuktu.

“We locked them inside rooms, and then we fled to Bamako,” he said.

Haidara alone owned an estimated 45,000 pages of manuscripts, so he traveled to Dubai to seek funding from an Islamic center there. He first approached the Dutch and German governments and later flew to Lagos, Nigeria, to meet with the Ford Foundation. The Dutch government gave $425,000, while the Ford Foundation donated $236,000. The German Embassy in Mali and the Dubai center did not respond to e-mails for comment.

“It was clear that manuscripts were in danger,” Joseph Gitari, a senior Ford Foundation employee in Lagos, said in a telephone interview. “The narrative of the manuscripts, their focus on science, culture, law, contradicted the ideological position of the groups who took over northern Mali.”

By August, Haidara said, he had secured some of the necessary funds to pay for fuel and transportation. To pay the smugglers, he borrowed money or promised to pay later. The manuscripts of the old Ahmed Baba Institute, the most prominent of the repositories, would be the first to leave Timbuktu.

‘An Indiana Jones moment’

It was the first stage of that mission that brought Traore and his donkey caravan to the old-city streets of Timbuktu on that August night. His grandfather had helped him load the donkeys, but he stayed behind as Traore and three other men set out with the manuscripts.

The rain, in the end, helped them. The jihadists were not at their checkpoints, preferring to stay indoors.

The caravan arrived at a safe house. Traore gave the cargo to a trader working for Haidara. Over the next two weeks, the donkey caravans would make the trip six more times until all the manuscripts were out of the center, Traore recalled.

The documents were placed in metal trunks hidden under cargo on several trucks. Within days, the manuscripts reached Bamako.

Over the next few months, Haidara’s people took out the rest of the manuscripts from the safe houses. Some were carried on donkey carts. Others were carried out on canoes on the Niger River, before reaching a safe area where they could be placed on trucks.

Most of the trunks were taken out in batches of three to five, until all finally reached Bamako safely. The evacuation was still ongoing in late January as French troops closed in on Timbuktu.

“The operation continues,” wrote Gitari to his colleagues in New York in an e-mail. “An Indiana Jones moment in real life! Touch wood.”

In the end, a total of 2,453 trunks were evacuated — containing about 278,000 pages of manuscripts, Haidara said.

In Bamako, the manuscripts are being kept in a safe place. Neither Maiga nor Haidara would disclose the location.

But Haidara and his allies could do nothing about the 16,000 pages of manuscripts in the new Ahmed Baba center, where the jihadists lived. There, Maiga’s worst fears came true. Days before French forces entered Timbuktu, the fleeing jihadists burned about 4,000 pages of manuscripts that they found in the restoration room.

But the jihadists never headed to the basement, where about 12,000 pages were stacked on metal shelves.

“They didn’t know the documents were down below,” said Abdoulaye Cisse, the institute’s interim director. “How else can you explain why they weren’t burned?”