Somali elite units have ended a siege by al-Shabab militants in a Mogadishu hotel, where at least 18 people were killed.
Security forces killed the last remaining attacker at 8.30am local time on Saturday, 13 hours after the Islamist militants attacked the popular Maka-Almukarama hotel in the capital, according to police.
At least 10 civilians were killed and many others injured, senior police officer Cornell Adan Hersi said.
Prominent Somali politicians, diplomats, government officials, journalists and doctors were at the luxury hotel at the time of the assault.
Six militants and two security forces personnel were among the dead, Hersi said.
Gunfire and explosions could be heard throughout the night as Somali special forces tried to dislodge the jihadists from the hotel.
Some of the attackers hurled grenades, Hersi said.
"The incident is over, as all terrorists who launched the attack were killed. Security forces rescued all the remaining civilians held hostage in the hotel," he said.
The assault on the hotel began Friday afternoon with a suicide car bombing, followed by a second bomber blowing himself outside the building.
Armed with machine guns and rocket-propelled grenades, the attackers then stormed the building, killing and wounding guests and hotel employees.
Among the dead was Yusuf Mohamed Ismail Bari-Bari, Somalia's permanent representative to the United Nations office in Geneva, according to the Somali government.