A siege by Al-Shabaab Islamist militants of a hotel in the Somali capital Mogadishu ended on Friday after more than 13 hours, a police officer told AFP.

The assault, which began late Thursday, broke a relative lull in violence by the Al-Qaeda-linked jihadist group, demonstrating its continued ability to strike despite a major military offensive against the militants.

"All the terrorist gunmen were killed, and the situation has returned to normal now, the security forces are carrying out a thorough clearance and investigations," said the officer, Abdirahim Yusuf.

Armed fighters stormed Mogadishu's SYL hotel -- the target of several previous attacks -- in a hail of bullets at around 9:45 pm (1845 GMT), with Al-Shabaab claiming responsibility in a brief statement.

As of Friday morning, it was still not known if there were fatalities and there has been no official government statement on the attack which occurred during the Muslim holy month of Ramadan.

Witnesses said police officers arrived at the hotel within minutes of the attack, triggering a fierce gun battle.

The SYL has been hit by Al-Shabaab several times in the past, most recently in 2019.

The jihadists have been waging war against the internationally backed federal government for more than 16 years and have often targeted hotels, which tend to host high-ranking Somali and foreign officials.

Although the militants were driven out of the capital by an African Union force, they retain a strong presence in rural Somalia and have carried out numerous attacks against political, security and civilian targets, including in Mogadishu.

The beleaguered central government launched a major offensive against the Islamists in August 2022, joining forces with local clan militias.

But the offensive has suffered setbacks despite early gains.