Malian troops searched house-to-house in Timbuktu following hours of fighting with Islamist rebels who had infiltrated the northern desert town.
Residents said calm had returned by late last night after heavy clashes and airstrikes by French fighter jets backing the Malian troops forced rebels to shelter indoors.
The fighting reflected the difficulty of securing Mali after a French intervention in January that pushed the rebels out of their northern strongholds.
Malian military sources said soldiers were sweeping parts of the town to ensure there were no remaining rebel fighters.
At least one Malian soldier was killed in the clashes, along with more than 20 insurgents, according to a government statement.
Residents said at least five civilians were killed in the crossfire.
An army spokesman said that groups of rebels had entered the town after setting off a suicide car bomb at a checkpoint, diverting the military's attention.
France is keen to reduce its current 4,000-strong troop presence to 1,000 by the end of the year as it hands over its mission to a regional African force.