Few residents said they actually met the hardened men who had taken control of their village, but Kola Maiga, who lives at the edge of town, recalled their arrival on the morning of Jan. 14.

“I was in my house, and I saw them coming, and I knew, I knew that war was here in Diabaly,” Mr. Maiga said. “The first day, they started shooting in the air. They wanted the population to know they have power.”

He feared them, he said, but they tried to reassure him, offering cookies to his children.

“They said: ‘Do not be afraid. We are with Allah,’ ” Mr. Maiga said.

Militants have also abandoned the town of Douentza, which they held for several months, The Associated Press reported.

Mali has been in crisis since last January, when Tuaregs in northern Mali began a separatist uprising, newly invigorated by an influx of fighters and weapons from Libya after the fall of Col. Muammar el-Qaddafi.

A military coup by junior officers angry at how the government responded to the Tuareg uprising followed in March, leaving the country in disarray and hastening the loss of its northern half to insurgents. Islamist groups, some with links to Al Qaeda, quickly pushed aside the secular Tuareg militants, taking over northern towns and imposing their strict interpretation of Shariah law.

The fighters appeared to find little support among the local population, who said the harsh version of Islam they sought to impose had little resemblance to the moderate faith practiced by most people here.