The looting that took place here, along with reports of army executions of suspected Islamists and their allies, has raised fears that Mali, after two decades of peace among its many ethnic groups, is headed for a period of deep ethnic tension. That prospect is dampening the celebrations over the retaking of Timbuktu on Monday by French and Malian soldiers from the Islamist militants who occupied it.

The rebellion in Mali started with disgruntled members of the Tuareg ethnic group, who have risen up three times since Mali won its independence from France in 1960 to demand a state of their own. But Islamists with links to an extremist group, Al Qaeda in the Islamic Maghreb, quickly overran the secular rebels. They planned to turn northern Mali into an Islamic state, and some ethnic Arabs and black Africans joined their cause.

These alliances have driven deep wedges in this crossroads city, where the two ancient superhighways of the Sahara — the fabled caravan route and the Niger River — meet, bringing travelers from far and wide who have long found ways to live together in relative peace.

“Before, we were friends,” said Dramane Cissé, the imam of one of the city’s most important mosques. “But this is not the first time the Tuaregs have made trouble. They brought calamity on us. After this, the relationship will not be the same.”