A Somali soldier at the scene of car bombings in Mogadishu.
CNN  — 

A series of car bombings killed at least 30 people and injured almost 100 in the Somali capital of Mogadishu on Friday afternoon, police and medical officials said.

Three car bombs were detonated near the Sahafi Hotel, police told CNN.

Five attackers attempted to storm the hotel but were shot and killed by police, Somali police spokesman Col. Qasim Ahmed Roble told reporters.

Fifty-two Somali officials were rescued from the Sahafi Hotel and the nearby Hayat Hotel, he said.

People gather in the street amid wreckage from car bombings in Mogadishu, Somalia.

Among the wounded are the police commissioner of Mogadishu’s Hodon district, Abdifitah Bashir, and former director general of the country’s Ministry of Information, Abdirizak Yusuf, according to police.

Abdiaziz Ibrahim, a former spokesperson for the Internal Security Ministry, who was at the scene, told CNN the attacks lasted 20 minutes and happened “one after the other.”

One of the victims was the owner of the hotel, Ibrahim said.

“Those who carried out the attack were dressed in police uniform, but they were Al Shabab attackers,” he said.

Al-Qaeda-affiliated terror group Al-Shabaab has claimed responsibility for the bombings, saying it had killed a number of people.

Al-Shabaab is a Somali group that the United States designated as a foreign terrorist organization in March 2008. It wants to turn Somalia into a fundamentalist Islamic state, according to the Council on Foreign Relations.

Somali Prime Minister Hassan Ali Khaire sent condolences to the victims’ families and wished speedy recovery to the injured, according to a statement posted on his official Twitter account.

The United National Assistance Mission in Somalia condemned the attack.

“Such reprehensible acts of terrorism will not in any way undermine the determination of the Somali people to pursue their state-building, economic recovery and security priorities,” said the UN Secretary-General’s deputy special representative for Somalia, Raisedon Zenenga, in a statement.

CNN’s Anna Cardovillis reported from Nairobi and journalist Omar Nor reported from Mogadishu. CNN’s Ralph Ellis wrote in Atlanta.