Nine people, including three soldiers, have been killed in an extremist attack on a popular beachside hotel in the Somali capital, Mogadishu.

Police said 10 other people were wounded while 84 people were rescued after the assault that began on Friday evening at the Pearl Beach hotel, ending early on Saturday morning.

Al-Qaida’s East Africa affiliate, al-Shabab, claimed responsibility for the attack.

Tuktuk
A destroyed tuktuk outside the Pearl Beach hotel in Mogadishu (AP)

The Somalia-based extremist group is known for carrying out attacks on hotels and other high-profile locations in Mogadishu, usually starting with a suicide bombing.

Witnesses had told The Associated Press that some people were trapped inside the Pearl Beach, which is popular with government officials. The Lido Beach area is one of Mogadishu’s most popular.

Abdulkadir Adan, the director of Amin Ambulance service, said that “what occurred last night was quite tragic as it occurred in an unexpected setting and at an unexpected time”.