At least eight people have been killed and 14 injured as Somali security forces ended a siege by extremist fighters who stormed a hotel in the capital Mogadishu.
Four al-Shabab attackers were also killed in the attack on the Dayah hotel, which is often frequented by government officials, said Colonel Mohamoud Abdi, a senior Somali police officer.
Survivors described chaotic scenes in which hotel residents hid themselves under beds and others jumped out of windows of the four-storey building to escape the extremist attackers.
"They kicked down room doors and at some point posed themselves as rescue teams by telling those inside to come out, (only) to kill them," said Hassan Nur, a traditional Somali elder who participated in the election of members of Somalia's new parliament.
He said two well-known clan elders were among those killed by the attackers in the hotel.
The assault on the hotel started when a suicide car bomb exploded at its gates.
Dozens of people, including politicians, were thought to have been staying at the hotel at the time of the morning attack, said Captain Mohamed Hussein.
Heavy gunfire could still be heard inside the hotel, he said.
A nearby shopping centre caught fire and dozens of people helped save goods in the business premises.
Somalia's homegrown Islamic extremist group al-Shabab claimed responsibility for the attack via its online radio, Andalus, saying its fighters succeeded in entering the hotel and an "operation is ongoing now".
Al-Shabab frequently targets hotels and other public places often visited by government officials and foreigners.
Al Qaida's East African affiliate is fighting to impose a strict version of Islam in the Horn of Africa nation.
In June, gunmen stormed the Nasa-Hablod hotel, killing at least 14 people.
Two weeks before that, gunmen killed 15, including two members of parliament, at the Ambassador hotel.
Despite being ousted from most of its key strongholds, al-Shabab continues to carry out deadly guerrilla attacks across large parts of south and central Somalia.
Earlier this month, a bomb explosion at a restaurant in Mogadishu killed three, and a suicide bomber detonated an explosives-laden vehicle at a security checkpoint near Mogadishu's international airport, killing at least three.
That blast occurred a few hundred metres from the main base of the African Union peacekeeping mission.
Al-Shabab's assaults have threatened the nation's attempts to rebuild from decades of chaos.
The presidential election, a key step towards recovery, has already been delayed several times because of security and other concerns.