Rescue teams found the bodies, along with 10 survivors and "significant material damage," at a military post in Indelimane, in the country's north-east, on Friday, government spokesman Yaya Sangara said in a statement.
The situation is now under control and the bodies are being identified, Sangare added.
The government called the assault a terrorist attack and urged the nation "to succeed in the war for freedom, peace and social cohesion in our country . "
No group has claimed responsibility for the assault.
The attack is one of the deadliest on military personnel in recent years. It follows separate attacks on army posts in central Mali in September that killed 38 soldiers.
A jihadist insurgency spread into the north and center of Mali in 2012, and foreign troops and government have been unable to fully regain control of some regions of the landlocked West African country.
training the Malian government forces in their fight against rebels in recent years, offering its condolences to the victims and the relatives of those killed in Friday's attack.
"The European Union stands by the government and the Malian nation to counter this serious violence," it said in a statement.
"We continue to engage in the support of Mali to allow the country to re-establish the full authority of the state over all its territory, to assure its development and the prosperity of its citizens."