MOGADISHU, Somalia - Blood spattered utensils, bullet-pocked walls, and overturned chairs mark the reception area of a prominent hotel in the Somalian capital after an attack by Islamic extremists that killed at least 24, including six attackers.

Somalian special forces stood over three bloodied bodies of the alleged attackers after officials declared they have full control of the Maka Al-Mukarramah Hotel on Saturday, more than 12 hours after gunmen from the Islamic rebel group al-Shabab stormed in.

The gunfire has stopped and security agents have gone through the whole building, said Police Capt. Mohamed Hussein. He had earlier said the gunmen were believed to have occupied the third and fourth floors of the hotel in the capital, Mogadishu.

"The operation has ended. We have taken full control of the hotel," Hussein said.

Eighteen people were killed in the attack, including one solider, said Hussein. At least 28 were wounded, according to Hussein Ali, an official of Mogadishu's ambulance service.

Officials claimed to have killed six attackers but only displayed the bodies of three and did not give the location of the bodies of the other attackers.

Al-Shabab claimed some of the gunmen involved in the attack escaped, in a statement released Saturday. The group vowed to carry out more attacks.

Somalia's ambassador to Switzerland and Permanent Representative to the United Nations Office in Geneva, Yusuf Bari-Bari was among those killed in the attack, said Somali President Hassan Sheikh Mohamud.

Al-Shabab, an al-Qaeda-linked Islamic extremist group that has carried out many attacks in Somalia, claimed responsibility for the assault on the hotel, which is popular with Somali government officials and foreigners.

Al-Shabab controlled much of Mogadishu between 2007 and 2011, but was pushed out of Somalia's capital and other major cities by African Union forces.

The attack started around 4 p.m. Friday when a suicide bomber detonated his explosives-laden car at the gate of the hotel. Gunmen then quickly moved in.

Hours later, the militants were still holed up in the hotel's dark corridors and rooms. Sporadic gunfire could be heard, but it appeared that the security forces waited until daybreak before trying again to dislodge the militants.

The attack was condemned by the African Union mission to Somalia in which troops from several African countries support Somalia's weak government.

"Their action will not dampen our spirit for the common good of Somalia, but will further strengthen us to work even harder to defeat the enemy of peace and development," said Ambassador Maman S. Sidikou, the African Union's representative in Somalia.

U.S. State Department spokeswoman Marie Harf praised Somalian forces "for their response to this terrorist attack" and pledged support for the government's efforts to "bring stability, security, and prosperity to all Somalis."