Suicide attackers set off two car bombs at a hotel in Mogadishu, killing at least 22 people, police say.
The militant Islamist group al Shabaab, linked to al Qaeda, claimed responsibility for the attack on the Hotel Sahafi, which is near the headquarters of Somalia's Criminal Investigations Department (CID).
Hotel guards and CID officers opened fire after the blasts, police added. Then, about 20 minutes later, a third explosion from a bomb placed in a three-wheeled "tuk-tuk" vehicle near the hotel hit the busy street, witnesses said.
"Four militants who attempted to enter the hotel were shot dead by our police and the hotel guards," police captain Mohamed Ahmed told Reuters.
"Two other militants were suicide car bombers who were blown up by their car bombs. The third car was remotely detonated. So in total 28 people died, including the six militants."
Abdifatah Abdirashid, who took over the Sahafi from his father after he was killed in a militant attack in 2015, was among those who died in Friday's attack, said Mohamed Abdiqani, a witness at the hotel.
"The militants who entered the hotel compound faced heavy gunfire from the hotel guards. Abdifatah Abdirashid, the hotel owner, and three of his bodyguards died," Mr Abdiqani said.
A Reuters photographer at the scene saw 20 bodies of civilians and burnt-out minibuses, motorbikes and cars.
Abdiasisi Abu Musab, al Shabaab's spokesman for military operations, said the group had singled out the Sahafi for attack because of its association with the government the Islamists want to overthrow.
"We targeted it because it acts as government base. Government officials and security forces are always in the hotel."
Somalia has been engulfed by violence and lawlessness since dictator Mohamed Siad Barre was toppled in the early 1990s.