Somali security officers secure the scene of a suicide car bomb explosion, at the gate of Naso Hablod Two Hotel in Hamarweyne district of Mogadishu on Oct. 28. (Feisal Omar/Reuters)

A pitched gun battle continued inside a popular hotel in Somalia's capital Saturday, after a suicide truck bomb exploded outside, killing at least 23 people and wounding more than 30, police said. Two more blasts were heard, one when an attacker detonated a suicide vest.

Speaking to the Associated Press by telephone from the scene, Police Capt. Mohamed Hussein said more than 20 people, including government officials, were thought to be trapped as the extremists holed up on the top floor of the Nasa-Hablod hotel, close to the presidential palace. Three of the five attackers were killed, Hussein said. The others hurled grenades and cut off the building's electricity as night fell.

Saturday's blasts came two weeks after more than 350 people were killed in a massive truck bombing on a busy Mogadishu street in the country's worst attack.

Al-Shabab, Africa's deadliest Islamist extremist group, quickly claimed responsibility for Saturday's attack and said its fighters were inside the hotel.

Among the dead were a mother and three children, including a baby, all shot in the head, Hussein said. Other victims included a senior Somali police colonel, a former lawmaker and a former government minister. Footage from the scene showed twisted vehicles and nearby buildings with only walls left standing.

Mohamed Dek Haji said he survived the bombing as he walked beside a parked car that was largely destroyed by the explosion. He said he saw at least three armed men in military uniforms running toward the hotel after the bombing at its gate.

"I think they were al-Shabab fighters who were trying to storm the hotel," he said from a hospital bed. He suffered injuries on his shoulder and skull from flying glass.

Witnesses in some previous attacks have said al-Shabab fighters disguised themselves by wearing military uniforms.

Security officials said that Saturday's bomber pretended to have a broken-down truck outside the gate.

Police Col. Mohamed Abdullahi said that the bomber stopped outside the heavily fortified hotel and acted as if he was repairing the truck before finally turning it around and detonating the bomb.

Al-Shabab often targets high-profile areas of Mogadishu. It has not commented on the attack of two weeks ago; experts have said the death toll was so high that the group hesitated to further anger Somali citizens as its pursues its insurgency.

Since the blast two weeks ago, President Mohamed Abdullahi Mohamed has visited regional countries to seek more support for the fight against the extremist group, vowing a "state of war." He also faces the challenge of pulling together regional powers inside his long-fractured country, where the federal government is only now trying to assert itself beyond Mogadishu and other major cities.

A 22,000-member multinational African Union force in Somalia is expected to withdraw its forces and hand the country's security to the Somali military by the end of 2020. U.S. military officials and others in recent months have expressed concern that Somali forces are not ready.

The U.S. military also has stepped up military efforts against al-Shabab this year in Somalia, carrying out nearly 20 drone strikes, as the global war on extremism moves deeper into the African continent.