In the wake of a night-long assault on a Mogadishu hotel in which 23 people were killed, Somalia's government has fired the police and intelligence chiefs Sunday.

The Cabinet voted to sack the chiefs in response to a recommendation by Somalia's security minister Mohamed Abukar Islow after two serious extremist attacks in the capital this month.

Early Sunday Somali security forces brought an end to the siege at the Nasa-Hablod by five extremist attackers who stormed the building after a suicide car bomber detonated an explosives-laden vehicle at the entrance gate on Saturday afternoon.

Troops killed three attackers and captured two alive, said Police Capt. Mohamed Hussein.

Al-Shabab, Africa's deadliest Islamic extremist group, claimed responsibility for the attack.

The blast twisted vehicles and caused massive damage to nearby buildings which were left with only their walls standing. Two more blasts were heard, one when an attacker detonated a suicide vest. The government's Minister of Electricity & Water Salim Aliyow Ibrow was rescued from the hotel as heavy gunfire continued in the shoot-out.

Saturday's bomber had pretended his truck had broken down before detonating it in front of the hotel's fortified gate, said police Col. Mohamed Abdullahi.

The weekend hotel attack came two weeks after more than 350 people were killed in a massive truck bombing on a busy Mogadishu street in Somalia's worst-ever attack.

Somalia President Mohamed Abdullahi Mohamed said the new attack was meant to instill fear in Somalis who united after the Oct. 14 bombing, marching in the thousands through Mogadishu in defiance of al-Shabab.

Al-Shabab often targets high-profile areas of Mogadishu. Although it quickly claimed responsibility for Saturday's attack, it has not commented on the massive attack two weeks ago. Experts have said the civilian death toll in the earlier bombing was so high that the rebels feared that blast would alienate Somali citizens.

Since the blast two weeks ago, the president has visited regional countries to seek more support for the fight against al-Shabab, 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 trying to assert itself beyond Mogadishu and other major cities.

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.

The U.S. mission in Somalia on Sunday condemned the latest attack, saying the U.S. "remains committed to work with our Somali, African Union, and international partners to degrade and defeat terrorism as Somalia continues on a path to stability and prosperity for its people."

The 22,000-strong multinational African Union force in Somalia is expected to withdraw its forces and hand over 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 yet ready to take over.

The two attacks this month have shaken public confidence in the ability of Somali army to take over from the African Union forces. Many in the capital accuse the government of not doing enough to protect them.

"We are dying in hundreds now," said Ahmednur Hashi, a Mogadishu resident. "Who is going to protect us?"