No one has claimed responsibility for that attack.
Mohamed Ahmed, a tuk-tuk driver, who was driving by the Nasa-Hablod hotel at the time of the attack, said he "saw a vehicle exploding at the gate of the hotel".
Ali Nur, a police officer, told Reuters 17 people, mostly policemen, had died in the blasts.
Two of the five attackers were killed on the first floor, Hussein said.
Bombs in Mogadishu two weeks ago killed at least 358 people, the worst such attacks in the country's history, igniting nationwide outrage.
A taxi driver at the scene told AFP he saw four bodies being carried away, while another witness called Yusuf Moalim said a senior police official appeared to be among the victims, whose vehicle had been near the hotel entrance when the blast occurred.
Islamist group al-Shabab, responsible for scores of such attacks in the country's long civil war, said it carried out Saturday's bombings.
Mohamed Dek Haji said he survived the bombing as he walked beside a parked vehicle that was largely destroyed by the explosion.
"I think they were al-Shabab fighters who were trying to storm the hotel", he said, lying on a hospital bed. He suffered small injuries on his shoulder and head from flying glass.
On Saturday, a suicide vehicle bomb was rammed into a hotel, Nasahablod Two, about 600 metres from the presidential palace, and then armed militants stormed the building, police said.
In a written statement, the ministry said on its website: "We strongly condemn this heinous terrorist attack".
Its sister hotel, the Nasahablod, was targeted by Al Shabab in a similar attack that killed 11 people in June past year.
Terror group Al-Shabab, which has links to al-Qaeda, often targets high profile areas in the city. USA military officials and others in recent months have expressed concern that Somali forces are not yet ready.