Somali authorities say at least 16 people have been killed and 55 more wounded in a car bomb and gun attack on a hotel in the centre of Mogadishu.

Sporadic gunfire could still be heard on Thursday, a day after the attack on Hotel Ambassador.

Al-Shabab, the anti-government group affiliated with al-Qaeda, claimed responsibility for Wednesday's attack.

Two legislators were among the dead.

"So far we have confirmed that 16 people, mostly civilians, died and 55 others were injured," Major Nur Mohamed, a police officer, told Reuters news agency on Thursday.

He said gunfire had died down at the hotel, adding: "We suspect the roof top is not safe. Security forces are inside from the first to fourth floor."

Government forces have blocked off all the main roads near the hotel.

Extensively damaged

Reuters witnesses said intermittent gunfire could still be heard at the Hotel Ambassador, a five-storey building which has been extensively damaged.

Relatives were gathering at hospitals and at the hotel searching for loved ones, with some people believed trapped inside.

A Reuters witness heard one man on the fifth floor crying out: "Please rescue me."

Sources earlier told Al Jazeera that at least three fighters were involved in the attack.

The attack happened shortly before the arrival of Turkish President Recep Tayyip Erdogan in Mogadishu.

Al Jazeera's Mohammed Adow, reporting from Nairobi in neighbouring Kenya, said the Ambassador Hotel is located along the road that Erdogan "was supposed to take from the airport to the presidential palace".

He said the attack "has the signature of al-Shabab", adding that it was not the first time the hotel, popular with politicians, was targeted.

"They want to send a message that although they might have lost control of the city, they can still carry out such attacks with audacity," he said.

In February, at least nine people were killed when al-Shabab fighters set off a car bomb at the gate of a popular park near a hotel in the capital.

In January, an attack on a beach-front restaurant killed at least 17 people.

In recent attacks, the armed fighters have also taken civilians as "legitimate targets", Al Jazeera's Adow said.

Loss of strongholds

Al-Shabab was pushed out of Mogadishu by the African Union peacekeeping force AMISOM in 2011.

Last year it was turfed out from strongholds elsewhere in the south by AMISOM and the Somali National Army.

However, it has remained a potent threat in Somalia, launching frequent attacks aimed at overthrowing the government.

The group has also been behind deadly attacks in Kenya and Uganda. Both contribute troops to an African Union peacekeeping force in Somalia.