The death toll in an overnight attack by al-Shabab extremists on a popular restaurant in Somalia's capital has risen to 31.
Police captain Mohamed Hussein said many of the victims were killed at point-blank range after the attackers hunted them down.
Police say nearly 40 people were wounded in the assault that began when a car bomb exploded outside the Pizza House restaurant in Mogadishu.
Security forces ended the siege on Thursday morning after the extremist snipers fired on them. Capt Hussein said all five attackers were killed.
Survivors described harrowing scenes of hiding under tables and behind curtains as attackers searched for patrons in the darkened restaurant.
Al-Shabab claimed responsibility shortly after the assault began, when a car bomb exploded at the gate to the restaurant and gunmen posing as military troops stormed in.
The roofs were blown off the restaurant and nearby buildings by the blast.
Soldiers surrounded the building and used vehicle-mounted guns to neutralise the attackers. Troops then entered the ground floor while the extremist snipers held positions upstairs.
All five attackers were killed and the soldiers secured the building after dawn. Efforts to take control of the restaurant had been slowed by the onset of nightfall, Capt Hussein said.
Saida Hussein, a university student, said she survived by hiding behind a large table downstairs."I never thought I would have the chance to see the sun again," she said.
"They were killing people on sight."
Another survivor, Aden Karie, was wounded by an attacker who spotted him moving behind a curtain.
"He shot at me twice and one bullet struck me on the leg," he said.
The bodies of five girls thought to have been killed by the extremists were found in the restaurant, police said.
Inside the building, the body of a Syrian man who worked as a chef there lay near the rubble of a blood-spattered and bullet-marked wall.
Many early victims were young men who had been entering the Pizza House when the vehicle exploded, Capt Hussein said.
The gunmen "were dressed in military uniforms. They forced those fleeing the site to go inside" the restaurant, witness Nur Yasin said.
While al-Shabab claimed to have attacked the neighbouring Posh Treats restaurant, which is frequented by the city's elite and was damaged in the blast, security officials said the Pizza House was targeted instead.
Security forces rescued Asian, Ethiopian, Kenyan and other workers at Posh Treats as the attack continued, Capt Hussein said.
The Somalia-based al-Shabab often targets high-profile areas of Mogadishu, including hotels, military checkpoints and areas near the presidential palace. It has vowed to step up attacks after the recently elected government launched a new military offensive against it.
Al-Shabab last year became the deadliest Islamic extremist group in Africa, with more than 4,200 people killed in 2016, according to the Washington-based Africa Centre for Strategic Studies.
The extremist group also faces a new military push from the US after President Donald Trump approved expanded operations, including air strikes, against al-Shabab.
On Sunday, the US military in Africa said it carried out an air strike in southern Somalia that killed eight Islamic extremists at a rebel command and logistics camp.
Somalian president Mohamed Abdullahi Mohamed confirmed that air strike and said such attacks would disrupt the group's ability to conduct new attacks.
With a new federal government established, pressure is growing on Somalia's military to assume full responsibility for the country's security.
The 22,000-strong African Union multinational force, AMISOM, which has been supporting the fragile central government, plans to start withdrawing in 2018 and leave by the end of 2020.