Suspected Islamist fighters attacked a military camp in western Mali near the border with neighboring Mauritania before dawn Saturday, and three soldiers and nine attackers were killed, the Defense Ministry said.
Residents of a nearby village hid in their homes, officials and witnesses said.
A senior army officer said military intelligence and initial witness accounts indicated the attackers were Islamist fighters, mainly from the Peuhl ethnic group.
The raid took place a week after a Tuareg-led northern rebel alliance signed a peace deal with the government aimed at ending their uprising and allowing the authorities to focus on fighting Islamist militants.
Gunfire erupted at around 5 a.m. (0500 GMT) in the town of Nara, around 30 kilometers (19 miles) south of border with Mauritania.
A resident of Nara said gunfire could be heard several hours after the clashes began and town residents locked themselves inside their homes. Heavy fighting flared again around midday before ending in the early afternoon.
The Defense Ministry statement said the gunmen attacked a military camp in
Nara, though an army spokesman said they also targeted a bank.
Government soldiers carried out house-to-house cleanup operations throughout the afternoon.
A relatively new Peuhl armed group called the Massina Liberation Front, which is suspected to have clashed with government troops in the central Mopti region earlier this month, has been blamed for a growing number of attacks.
A French-led military campaign in early 2013 liberated northern Mali from al-Qaida-linked Islamist rebels, who seized control of the area after the Tuareg uprising led to a military coup that plunged Mali into chaos.
Insecurity persists, however, and though the violence, often blamed on the remnants of Islamist groups, is generally focused in the desert north, attacks have in recent months crept further south.
Dozens of suspected Islamist militants attacked a police base near Mali's southern border with Ivory Coast earlier this month.