Somali forces have ended a more than 20-hour battle to regain control of a hotel seized by militants in Mogadishu on Sunday evening.
At least 14 people were killed, including eight civilians, during the siege, police say.
Militants from the al-Shabab group , which said it was behind the attack, had been holed up in one of the rooms in the Villa Rays hotel.
Witnesses told the BBC they heard explosions and gunshots at the hotel.
Somali police have said that 60 people were rescued from the hotel, which is near the presidential palace.
As well as the eight civilians who died during the siege, one soldier was killed as well as five al-Shabab fighters, police spokesperson Sadik Dodishe confirmed.
The Villa Rays hotel, which has also been referred to as Villa Rose, is popular with government officials and several ministers have confirmed being rescued.
At least one minister, Mohamed Ahmed, is reported to have been injured while another, Environment Minister Adam Aw Hirsi, told reporters he had survived the attack.
Speaking to the BBC Mr Hirsi described the impact of the initial blast: “We prayed evening prayers in the small mosque in the hotel and there is this big explosion, deafening explosion, massive, that shattered glass everywhere, that shook the foundation of the building in which we were meeting.
“As soon as the explosion took place we had a 120 seconds leeway between the explosion and the terrorist foot soldiers coming,” he continued.
An unknown number of assailants, armed with explosives and guns, were involved, police officers told Reuters news agency.
One eyewitness described hearing a “huge blast, followed by a heavy exchange of gunfire”.
“We were shaken,” Ahmed Abdullahi, who lives close to the scene, told the news agency. “We are just indoors, listening to gunfire.”
Some government officials were rescued from Villa Rays after using windows to escape, said police officer Mohammed Abdi.
In August, three months after taking office, President Hassan Sheikh Mohamud pledged “total war” against the Islamist militants following an attack on another popular Mogadishu hotel. More than 20 people died.
Two months later, twin car bomb explosions near a busy junction in Mogadishu killed at least 100 people. Al-Shabab also said it was behind that attack.
President Mohamud subsequently mobilised the Somali army and government-backed clan militias in a bid to take villages and towns from al-Shabab, which controls large swathes of the country.
Al-Shabab has continued to carry out attacks in central and southern Somalia despite recent government troops backed by African Union forces and local militias retaking areas previously captured by the group.
BBC Africa correspondent Andrew Harding recently spent time with the so-called “lightning” brigade, which is funded by the US and plays a central role in the uprising against al-Shabab.
Al-Shabab has a long history of targeting hotels known to be frequented by government officials and foreigners.
The militant group’s central aim is to topple Somalia’s government and establish its own rule based on a strict interpretation of Islamic law.