Mogadishu, Somalia (CNN)Five people, plus four attackers, were killed in an attack at a hotel in Somalia's capital Mogadishu on Sunday, according to Somali police.
The deadly siege at the Afrik hotel which left 10 other civilians injured ended after Somali security forces battled militants for eight hours, police spokesperson Sadik Aden Ali said at a press conference early on Monday.
The attack began on Sunday afternoon 5 p.m. local time (9 a.m. ET) with a car bombing at the gate of the hotel frequented by government officials and politicians.
General Mohamed Nur Galaal -- a retired veteran military officer who once served as country's defense minister in 1991 -- was among those killed in the attack, according to police.
Dozens of other civilians were rescued by the security forces. Somali President Mohamed Farmaajo and Prime Minister Mohamed Hussein Roble both condemned the attack and sent their condolences to those who lost their loved ones.
"My heartfelt condolences to the families of the victims of the heinous terror attack in Hotel Afrik including Gen Mohamed Nur Galal who served his country with valor for over 50 years," Roble said via Twitter.
Al-Shabaab claimed responsibility for the attack through a statement broadcast by Andalus Radio, its mouthpiece channel. CNN has been unable to independently verify this claim.
The hotel is frequented by Members of Parliament, politicians, and security officials, but not foreigners. Outside the hotel is the main security checkpoint to the airport and Halane base, which houses western missions, including the US embassy.
The reason for the attack is unclear, but Somali police captain, Ahmed Hassan, told CNN that a top military commander was inside the hotel at the time of the attack. Other senior military officials and lawmakers were also inside the hotel, Hassan added.
The United Nations condemned the attack on Monday.
"We are appalled by this reprehensible and senseless attack on a venue frequented by innocent civilians, and condemn it in the strongest terms," the UN Secretary-General's Special Representative for Somalia, James Swan, said in a statement.
"The United Nations in Somalia expresses its condolences to the families of the victims, and wishes a speedy recovery to the injured," he added.
Al-Shabaab has claimed responsibility for the attack through a statement broadcast by Andalus Radio, its mouthpiece channel. CNN has been unable to independently verify this claim.
The Islamist insurgent group, according to the Council on Foreign Relations, wants to turn Somalia into a fundamentalist Islamic state.
It claimed responsibility for a a truck bombing outside Mogadishu in December which killed 85 including two Turkish citizens.
Another terror attack at a hotel in Kismayo in Somalia's Jubaland state in July left more than 26 people dead including journalists and local government officials.
The militant group also said it was behind a triple car bombing near a hotel in Mogadishu in which at least 52 people were killed and 100 injured in November 2018.
US forces that had been based in Somalia began their withdrawal from the country in December and were redirected to other bases in East Africa.
US troops in Somalia primarily train and advise local Somali forces as they battle Al-Shabaab. The US military also carries out airstrikes against the group and the local ISIS affiliate in the country, killing a top Al-Shabaab leader in a targeted strike in September.
Former US President Donald Trump ordered the majority of US troops to leave Somalia "by early 2021," in just one of the major military policy decisions taken in the final days of his administration.