The attack occurred on Sunday in the town of Tessit, in the troubled "three-border" region where the frontiers of the three nations - Mali, Niger, and Burkina Faso - converge.
The toll is one of the bloodiest in Mali's decade-long insurgency, which has spread from the north of the country to the centre and south and into neighbouring Burkina Faso and Niger.
The document revising the fatality number to 42 was authenticated to AFP by several senior military officials.
On Monday, the army had said 17 soldiers and four civilians had died. Relatives of the victims, speaking on condition of anonymity, said that some of the civilians had been elected officials.
Monday's statement also said that seven attackers had died, "probably members of the Islamic State in the Greater Sahara (ISGS) and benefiting from drone and artillery support and using explosives and an explosives-laden vehicle."
The last time Mali's armed forces sustained such losses was in a string of attacks in the same region in late 2019 and early 2020.
Hundreds of soldiers were killed in assaults on nearly a dozen bases, typically carried out by highly mobile fighters on motorbikes.
The raids prompted the Malian, Nigerien and Burkinabe forces to fall back from forward bases and hunker down in better-defended locations.
In March 2021, 33 soldiers were killed in an ISGS-claimed ambush as units were being rotated, and in February this year, around 40 civilians -- suspected by the ISGS of being in league with Al-Qaeda -- were massacred.
Across the Sahel, the jihadist campaign has claimed thousands of lives and forced more than two million to flee their homes.
Sporadic cross-border attacks have also occurred in Ivory Coast, Togo and Benin to the south, amplifying fears of a jihadist push towards the Gulf of Guinea.