MOGADISHU, Somalia — A suicide bomber has detonated an explosives-laden truck near the gate of Somalia’s presidential palace in the capital on Tuesday, killing at least 12 people, police say.

The bomb exploded during a morning traffic jam, said Capt. Mohamed Hussein, a senior police officer.

Some Cabinet ministers at the SYL hotel were among the 31 injured, said Hussein. The blast damaged nearby hotels often frequented by government officials and business executives, he said.

The explosion was heard across Mogadishu, and smoke was seen billowing over the area of the presidential compound.

Somalia’s Islamic extremist group al-Shabab has claimed the responsibility for the blast, according to the rebels’ Andalus radio station.

The injured were taken to Mogadishu’s Madina Hospital, said Dr. Mohamed Yusuf, the hospital’s director.

The massive blast left a trail of destruction across the hilltop presidential complex and to nearby hotels. The bombing tore into blast walls protecting hotels and blew off the roofs of nearby houses.

“Security forces tried to stop the bomber who used back roads before he sped through checkpoints near the presidential palace and detonated the bomb,” said Col. Ali Nur, a police officer. “He reached near the gate of the state house with flat tires.”

While al-Shabab has been ousted from most of Somalia’s cities, it continues to carry out bombings and suicide attacks, notably in the capital.

In late July, two al-Shabab suicide bombers detonated explosives-laden cars outside the office of the U.N.’s mine-clearing agency and an army checkpoint near the African Union’s main base in Mogadishu, killing 13.

Other attacks have targeted hotels. In June, extremist gunmen stormed the Nasa-Hablod hotel, killing at least 14. Two weeks before that, extremist gunmen killed 15, including two members of parliament, at the Ambassador hotel.