President Ibrahim Boubacar Keita announced the death toll and said seven people were wounded in the attack, which has been claimed by jihadist group Al Mourabitoun and al Qaeda in the Islamic Maghreb (AQIM).
November 20's assault on the Radisson Blu hotel is the latest in a series of deadly raids this year on high-profile targets in Mali, which has battled Islamist rebels based in its desert north for years.
"Tonight the death toll is heavy," Keita said on state television, declaring a 10-day state of emergency and three days of national mourning. He said two militants also died.
The attack is a sharp setback for former colonial power France, which has stationed 3,500 troops in northern Mali to try to restore stability after a rebellion in 2012 by ethnic Tuaregs that was later hijacked by jihadists linked to al Qaeda.
It also puts a spotlight on veteran militant leader Mokhtar Belmokhtar, whose group Al Mourabitoun staged the attack months after he was reported killed in an air strike.
Minister of Internal Security Colonel Salif Traoré said the gunmen burst through a hotel security barrier at 7 a.m. (0700 GMT), spraying the area with gunfire and shouting "Allahu Akbar", or "God is great" in Arabic.
The attack ended around 4 p.m. and a UN official said UN peacekeepers searching the hotel made a preliminary count of 27 bodies.