Officials say the death toll could climb after militants, who arrived on motorbikes and in cars, attacked a military base in the Gao region.
Unidentified gunmen killed at least 25 soldiers in an attack in the Gao region of northern Mali on Monday morning, army spokesman Diarran Kon told Reuters news agency.
The attack also wounded six others, in the latest bout of violence to hit the war-torn West African state.
Early Monday morning, militants attacked a military base in the northern town of Bamba in the region, according to a local government official, who called the assailants "terrorists" and said at least 20 soldiers had died.
Another local official gave a similar account, explaining that the assailants arrived on motorbikes and in cars.
"Investigations are still ongoing on the ground because the death toll must be higher than the 20 deaths announced," the official said.
'We saw 23 bodies on the spot'
Mali has been struggling to contain a militant revolt that first broke out in the north in 2012, and has since spread to the centre of the country and neighbouring Burkina Faso and Niger.
Thousands of Malian soldiers and civilians have died, despite the presence of thousands of French and UN troops.
It was not immediately clear who carried out Monday's attack.
A resident of Bamba, who spoke on condition of anonymity, said armed men had been riding motorbikes around nearby villages since Sunday, before gathering for the dawn attack.
"We saw 23 bodies on the spot," the Bamba resident said, describing the aftermath of the raid, adding that militants had destroyed the camp and stolen equipment.
"No civilian was hurt, this was an operation against the camp," the resident added.
A Malian army official stationed in northern Mali confirmed an attack had taken place in Bamba but said there had been losses on both sides.
He added the army did not have a clear idea of enemy losses as the raiders took their casualties with them when they left.
Another military official said that reinforcements had been dispatched to the area.
The attack in Mali follows another in militant-ridden northern Cameroon on Sunday.
Two suicide bombers — suspected to be members of Nigeria's Boko Haram group — blew themselves up in a border town in the Central African country and killed seven people.
Talks to stop violence
The Mali attack comes despite attempts to reinvigorate the country's political life in the hope of staunching the bloodshed.
The former French colony braved threats of violence and coronavirus infection on March 29 to stage much-delayed elections to parliament.
The hope is that the new assembly will implement reforms from a 2015 peace agreement brokered between the Bamako government and several armed groups.
Implementation has been painfully slow, although this year saw the Malian army deploy units made up of both former rebels and regulars — a key provision of the deal.
The pact also provides for government decentralisation, a demand for some of the rebel groups.
Parallel to these efforts, the government in Bamako has also said it is prepared to enter into talks with armed groups.
Al Qaeda-affiliated militants have indicated that they are prepared to negotiate with the government, but only if French and UN troops pull out.