The attack, claimed by the Al-Qaeda aligned Shabaab insurgent group, began when a car loaded with explosives rammed the gate of the Dayah Hotel near the Somali parliament and state house.
Gunmen then stormed the hotel and exchanged fire with security guards, according to police official Ibrahim Mohammed.
A second massive blast went off after ambulances and journalists had rushed to the scene, leaving at least four reporters injured, including an AFP photographer who received shrapnel wounds to his shoulder and leg.
"Two gunmen were killed and the area is under control of security forces," he said.
More From This Section
The Shabaab group claimed responsibility in a statement distributed on its Telegram messaging account.
"The mujahideen fighters have attacked a hotel and have managed to enter the hotel after detonating a car loaded with explosives," read the statement.
The Shabaab is fighting to overthrow the internationally-backed government of Somalia and regularly stages deadly attacks on government, military and civilian targets in the capital and elsewhere in the war-torn country.