Al Shabab militants stormed two hotels in the Somali capital of Mogadishu on Friday, killing at least five civilians, a police source said.
The militants attacked the Weheliye and Siyad hotels in central Mogadishu, setting off car bombs.
The Siyad hotel, which is located opposite the presidential palace, is used by government officials and foreign diplomats.
Somalia’s security forces exchanged fire with the militants in the most serious flare-up in weeks.
Among the dead were three attackers, a police officer said.
The attacks at the hotels took place as residents broke the Ramadan fast.
In another incident, a group of attackers targeted an African Union peacekeeping base in Mogadishu, throwing grenades.
Al Shabab have staged similar attacks in the past, demonstrating its strength despite the efforts by African Union troops to push the group back from its strongholds.
Somalia has been hit by instability since the overthrow of president Siad Barre in 1991.
Al Shabab have lost control over most of the territories it once held but still govern some areas and several vital ports, with the central government struggling to exercise control.