TIMBUKTU, Mali -- When the Islamist militants came to town, Ibrahim Maiga made a reluctant deal. He would do whatever they asked -- treat their wounded, heal their fevers, bandage up without complaint the women they thrashed in the street for failing to cover their heads and faces. In return, they would allow him to keep the hospital running as he wished.
Then, one day in October, the militants called him with some unusual instructions. Put together a team, they said, bring an ambulance and come to a sun-baked public square by sand dunes.
There, before a stunned crowd, the Islamist fighters carried out what they claimed was the only just sentence for theft: cutting off the thief's hand. As one of the fighters hacked away at the wrist of a terrified, screaming young man strapped to a chair, Dr. Maiga, a veteran of grisly emergency room scenes, looked away.
"I was shocked," he said, holding his head in his hands. "But I was powerless. My job is to heal people. What could I do?"
After nearly 10 months of occupation by Islamist fighters, many of them linked with al-Qaida in the Islamic Maghreb, the people of this ancient mud-walled city recounted how they survived the upending of their tranquil lives in a place so remote that its name has become a synonym for the middle of nowhere.
"Our lives were turned upside down," Dr. Maiga said. "They had guns, so whatever they asked, we did. It was useless to resist."
It has been only a few days since French and Malian troops marched into Timbuktu after heavy airstrikes chased the militants away, part of a surprisingly rapid campaign to retake northern Mali from the militants who held it captive for months. On Thursday, the French defense minister, Jean-Yves Le Drian, told French radio that the intervention had "succeeded" and reached "a point of change."
But while the Islamist militants have retreated to the desert, there are no illusions that they have ceased to be a threat.
As U.S. officials praised the speed of the French-led operation to recapture northern cities, they also cautioned that a lengthy campaign would be needed to root out the militants from their desert redoubts -- and that it was not immediately clear who would carry out the daunting task.
"This is all being done very much on the fly," one U.S. official said of the intervention. "The challenge will be to keep up the pressure when the sense is to declare victory and go home."
Here in Timbuktu, life is a long way from returning to normal. Shops owned by Arab tradesmen have been looted. Some residents have fled, a foretaste of ethnic strife that many fear will roil Mali for years to come. Electricity and running water are available only a few hours a day. The cellphone network remains down.
Many of the residents who left -- first to escape the occupation, then to escape the French airstrikes -- have no way to return. Always remote, the city remains dangerously isolated: The dusty tracks and rivers leading here wind through forbidding scrubland territory that could still provide refuge for the Islamist fighters who melted away from the cities.
Those who remained told stories of how they survived the long occupation: by hiding away treasured manuscripts and amulets forbidden by the Islamists; burying crates of beer in the desert; standing by as the tombs of saints they venerated were reduced to rubble; silencing their radios to the city's famous but now forbidden music.
"They tried to take away everything that made Timbuktu Timbuktu," said Mahalmoudou Tandina, a marabout, or Islamic preacher, whose ancestors first settled in Timbuktu from Morocco in the 13th century. "They almost succeeded."
On April 1, the day rebels arrived in this city, Mr. Tandina had just returned from the first, predawn prayer of the day. He made bittersweet tea to the murmur of a French radio broadcast. The news was bad: Gao, the largest city in northern Mali, had fallen to Tuareg rebels, the nomadic fighters who had been battling the Malian state for decades.
When shots rang out in Independence Square, just behind Mr, Tandina's house, he knew that Timbuktu's latest conquerors had arrived.