At least five people were killed in a gun-battle between militant Islamists and Somali security forces at a hotel in the capital, Mogadishu.
The attack at the Afrik Hotel began on Sunday after a car bomb explosion.
Al-Shabab said it was responsible. The group, which is linked to al-Qaeda, regularly carries out attacks against the government.
At least four attackers also died – according to AFP news agency three were shot and one blew himself up.
A car hit the hotel’s front entrance and detonated before gunmen stormed the building, according to officials and others at the scene.
“The operation is over now. Nine people, including four attackers, died and over 10 civilians were injured. There is no electricity,” a police spokesman told reporters from the scene and via Facebook.
Prime Minister Mohamed Hussein Roble said in a statement that among those killed was a former military general, Mohamed Nur Galal.
The militants targeted the Afrik Hotel despite the fact that it is in a heavily guarded area near the city’s main airport.
The hotel is known to be a gathering place for Somali government officials. A local police captain said a number of lawmakers and senior military officials were inside at the time of the attack.
Footage on social media showed large plumes of smoke rising across the city earlier on Sunday.
The siege comes weeks after former US President Donald Trump ordered the withdrawal of some 700 troops who had been supporting local security forces against militant groups, including al-Shabab.