A second massive blast went off after ambulances and journalists had already rushed to the scene.
At least seven people were killed after two car bombs exploded outside a popular Mogadishu hotel Wednesday, and gunmen forced their way inside the building and opened fire, police said.
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 already rushed to the scene, leaving at least four reporters injured, including an AFP photographer who received shrapnel wounds to his shoulder and leg.
"So far we have counted about seven dead, most of them civilians and security guards. There are also many people who were wounded in the two blasts," said Mohammed.
"Two gunmen were killed and the area is under control of security forces," he said.
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 state, military and civilian targets in the capital and elsewhere in the war-torn country.
There has been an uptick in attacks on Mogadishu during a drawn-out process to elect a new government.
The hotel attack is the deadliest so far in 2017.
In December 2016 more than 20 people were killed when a truck laden with explosives was detonated near a military base close to the Mogadishu port.
Somalia has not had an effective central government since the 1991 overthrow of president Siad Barre's military regime which ushered in decades of anarchy and conflict in a country deeply divided along clan lines.
The clan rivalries and lawlessness provided fertile ground for the Al-Qaeda-linked Shabaab to take hold and seize territory, frustrating efforts to set up a central administration.
After a series of transitional governments were formed abroad, a previous parliament was chosen by 135 clan elders and set up in Mogadishu in 2012.
Somalis were promised a one-person, one-vote election.
But political infighting and ongoing insecurity due to the presence of Shabaab meant Somalis were handed a "limited" election, in which 14,025 specially picked delegates voted for 275 parliamentary seats distributed according to clan.
Another 72 seats in a new upper house were shared out according to region.
The lawmakers will soon vote for a new president, however a date has not been set for the election, which has been delayed numerous times.
The 2016 process is seen as taking the country a step closer to a universal suffrage election now planned for 2020.