Somali security forces have completed an operation to end a bomb and gun attack by militants on a central Mogadishu hotel that killed at least 16 people and wounded 55, authorities said on Thursday.
Police officer Major Farah Ali said the Ambassador Hotel was now secure after the entire building was cleared of militants.
"National security forces are in every floor, the last fighter on the top roof (was) shot," Ali told Reuters.
Islamist militant group al Shabaab, affiliated with al Qaeda, claimed responsibility for Wednesday's attack on Hotel Ambassador. Two lawmakers were among the dead in the attack which ended with police shooting the assailants.
"So far we have confirmed 16 people, mostly civilians, died and 55 others were injured," Major Nur Mohamed, another police officer, told Reuters on Thursday.
A witness told Reuters they saw the last fighter shot dead, his body falling to the ground from the building's fifth floor. Eight dead people lay in front of the hotel.
Al Shabaab was pushed out of Mogadishu by the African Union peacekeeping force AMISOM in 2011. But it has remained a potent threat in Somalia, launching frequent attacks aimed at overthrowing the Western-backed government. The group has also been behind deadly attacks in Kenya and Uganda. Both contribute troops to an African Union peacekeeping force in Somalia.
Sheikh Abdiasis Abu Musab, al Shabaab's military operations spokesman, told Reuters they had lost three fighters during the hotel attack and killed 30 people. Death tolls given by al Shabaab are usually much higher than those given by officials.
"We killed 30 apostates including MPs and soldiers….the operation was victorious as planned," Abu Musab said, adding they had injured 60 during the assault.
One of the three dead fighters drove the car that rammed the hotel while the others stormed the hotel, al Shabaab said.
Earlier, witnesses said sporadic gunfire had continued at the hotel early Thursday morning, with Police still combing the building's five floors for militants and to rescue those still trapped, Reuters reported.
A man on the hotel's top floor was heard by a witness crying out: "Please rescue me."
The building was extensively damaged during the attack and government forces had blocked off all the main roads near the scene.
Despite being driven off their turf, the group boosted its campaign in the country this year, carrying out several violent assaults since January, particularly at destinations frequented by foreigners, members of the Somali diaspora who have recently returned to Mogadishu, or upper-class residents.
Recent attacks include a bombing at the end of the February at a busy junction and a nearby restaurant in the town of Baidoa, killing as many as 55 people. Just two days earlier, al Shabaab claimed responsibility for a deadly park bombing and an attack at the nearby Somali Youth League hotel.
A mortar attack also occurred near the presidential palace that month, and a suicide bomber linked to the group detonated a bomb on a plane departing from Mogadishu's international airport. The bomber was killed and blew a hole in the plane, but the jet did not crash.
In January, al Shabaab gunmen killed more than a dozen people at a popular beach. The group has also expanded its violence into the semi-autonomous region of Puntland.
Reports also emerged on Wednesday that the US targeted a top al Shabaab commander in Somalia in a May 27 air strike. According to the Pentagon, they are still assessing the drone strike operation's results, despite some media reports that Abdullahi Haji Da'ud, a senior military commander for the militant group, had been killed.
The Pentagon has said the strike was carried out against the commander in south central Somalia. Pentagon spokesman Commander Bill Urban said the operation utilized a remotely piloted aircraft.
Follow VICE News on Twitter: @vicenews