The heavily-armed assailants rode into the community of Boulikessi, near the border with Burkina Faso, early Monday morning to attack a Malian battalion of the regional G5 Sahel Force, according to the governmen.
Around the same time, armed men attacked another army camp in Mondoro, also near the border.
Intense fighting continued on Tuesday with Malian troops backed by air support.
"Among the ranks of the FAMA (Malian armed forces) the provisional toll is 25 killed, four wounded...around 60 missing and heavy equipment losses," the government said, without detailing where they were killed.
Authorities said that after exchanges of gunfire, the army had retaken Boulikessi, killing at least 15 attackers.
Authorities said a joint force with Burkina Faso soldiers backed by French troops stationed in the region was pursuing the attackers, whom they called “suspected members of Ansarul Islam”.
Ansarul Islam has been accused of numerous attacks in Burkina Faso since emerging in the border region in 2016.
The toll is among the highest suffered by Malian forces this year as they struggle to contain militant groups with links to al Qaeda or Islamic State that have set up operations in parts of Mali from where they launch attacks across the Sahel.
Mali fell into the hands of jihadists in 2012 before the militants were forced out by a French-led military intervention. But much of the region remains unstable and jihadist-led violence has spread to the centre of the country, often sparking bloodshed between ethnic groups.