At least 14 Malian soldiers have been killed and 18 others wounded in an al-Qaeda attack during which fighters briefly took control of a military camp in the African country's north, the army has said.

"The Malian armed forces were attacked early this morning, around 4 am, in Soumpi (Timbuktu region). We have recorded 14 dead, 18 wounded and material damage," a statement from the military posted on social media said on Saturday.

The deadly attack forced Mali's President Ibrahim Boubacar Keita to cancel a visit to the African Union summit to be held in Addis Ababa, the capital of Ethiopia.

In the early hours of the fighting the army had lost control of the base to the fighters, but retook it by the afternoon, a Malian military source reached there has told AFP news agency.

"The Malian army is back in control of the camp. Two terrorists have been killed," the source said.

The Soumpi incident comes two days after 26 civilians including mothers and babies were killed when their vehicle ran over a landmine in Boni, central Mali, according to a UN death toll.

Malian government is increasingly losing its grip in the rural areas amid increased al-Qaeda attacks on government and foreign troops.

Armed groups under scrutiny

Al-Qaeda fighters in coalition with the Azawad movement took control of the vast desert in northern Mali in early 2012, but were largely driven out in a French-led military operation launched in January 2013.

In June 2015, Mali's government signed a peace agreement with coalitions of rebels that are not affiliated to al-Qaeda. But fighters remain active, and large tracts of the country are out of government control.

The UN Security Council on Wednesday unanimously adopted a French-drafted statement giving parties to the 2015 peace deal until the end of March to show progress or face sanctions.

The council said there was a "pressing need to deliver tangible and visible peace dividends to the population in the north and other parts of Mali" in advance of elections scheduled for this year.

Mali is one of a string of poor, fragile nations in Africa's Sahel region that has been battered by an ongoing war that predates the rise of al-Qaeda.

The country has joined the so-called "G5 Sahel force" with Mauritania, Niger, Chad and Burkina Faso, pooling military efforts to fight.

Mali has been facing an ongoing low-intensity civil war for years. While it is the third-largest producer of gold in the African continent, around half of its population lives on less than $1 a day, which is below the international poverty line.