Somali security forces have said they rescued 106 people who were trapped inside a hotel that had been stormed by militants on Friday night.
Twenty-one people died and 117 were injured in the 30-hour ordeal, the health ministry said. Officials say the fight to retake the hotel is now over.
The assailants used explosives to gain entry to Mogadishu’s Hayat Hotel before violently taking control.
Islamist militant group al-Shabab has taken responsibility for the attack.
Police Commander Abdi Hassan Mohammed Hijra told journalists about the numbers rescued, which he said included women and children, but did not give a death toll.
The hotel has been largely destroyed following intense fighting between the militants and security forces throughout Friday night and Saturday, with videos showing explosions and smoke billowing from the building’s rooftop.
“It has been terrible, really terrifying living next door to the gunfire, the explosions. It was one of the most horrible things I have ever seen in Mogadishu,” Abdisalam Guled, a former deputy director of Somalia’s national intelligence agency, told the BBC.
Relatives of those thought to have been in the hotel when the attack took place are now waiting to find out what happened to them.
“My brother was inside the hotel the last time we heard from him, but his phone is switched off now and we don’t know what to expect,” businessman Muktar Adan is quoted by AFP as saying.
A police officer told Reuters that two car bombs had been used to gain access to the hotel on Friday evening – targeting its front barrier and gate.
After the initial attack, a website affiliated to al-Shabab said a group of militants were “carrying out random shootings” after having “forcibly entered” the hotel – described as a popular location for employees of the federal government to meet.
Security forces struggled to gain access to the upper floors of the hotel for hours because the gunmen, who were holding an unknown number of people hostage, had reportedly bombed out the stairs needed for access.
The director of Mogadishu’s main trauma hospital told AFP that the facility was treating at least 40 people wounded in the hotel attack and a separate mortar strike on another area of the capital.
An affiliate of al-Qaeda, al-Shabab has engaged in a long-running conflict with the federal government.
The group controls much of southern and central Somalia, but has been able to extend its influence into areas controlled by the government based in Mogadishu.
In recent weeks, fighters affiliated with the group have also attacked targets along the Somalia-Ethiopia border, which has raised concerns about a possible new strategy by al-Shabab.
The attack on Friday marks the first in the capital by the group since Somalia’s new President, Hassan Sheikh Mohamud, was elected in May.
No group said it was behind that attack, although correspondents say all indications are that al-Shabab was responsible.