
Security services were earlier seen surrounding the Syl Hotel, usually frequented by government officials and lawmakers, following the attack claimed by the Al-Qaeda-allied rebels.
“Three soldiers died. Eighteen civilians and nine soldiers were injured in the hotel attack,” Kasim Ahmed Roble, police spokesman, told a news conference.
“All the five terrorists were shot dead and their bodies displayed.”
Al-Shabaab has been waging a brutal insurgency against Somalia’s federal government since 2006 to try to establish its own rule based on its interpretation of Islamic Sharia law.
In the attack, residents heard a blast followed by gunfire as the attackers entered the hotel, they told Reuters.
A second blast followed several minutes later, a Reuters journalist and a resident said.
Despite being pushed out of several territories by government-backed forces since the mid-2010s, the group still controls vast areas in southern and central Somalia and launches sporadic attacks on civilian and military targets.
In June, Al-Shabaab fighters killed nine people at the Pearl restaurant in the capital.
Its fighters also attacked the Syl Hotel in 2019.