A police official says Somalia's security forces have ended a deadly siege of a beachfront restaurant in the capital, with more than 20 people killed in the attack.

Capt. Mohamed Hussein, speaking from the scene of the attack in Mogadishu, said early Friday that security forces took control of the restaurant just before dawn.

It was not clear whether Hussein's report of more than 20 killed included the assailants.

Blasts and bursts of gunfire could be heard as Somali special forces went from room to room pursuing the al-Shabab gunmen who were holed up inside the restaurant.

Hussein says the security forces rescued many people who were trapped inside the restaurant's hall, where a party was taking place when the attack started Thursday.