Al-Shabab militants stormed Somalia’s parliament Saturday, according to officials, killing at least 10 security officers in a bomb-and-gun assault that the United States condemned as a “heinous act of terrorism.”

The attack started with a car bombing at a gate to the heavily fortified parliament compound, followed by a suicide bombing and then a gun battle that continued for hours. Al-Shabab is an al-Qaeda-linked group that killed 67 people at a Kenyan shopping mall last year.

“Ten government forces died and 14 others were injured in the attack today. Four lawmakers were also injured. Seven of the fighters who attacked the house were also killed, as you see their bodies,” Kasim Ahmed Roble, a police spokesman, told reporters at the scene.

Roble made no mention of civilian casualties.

A spokesman for al-Shabab, Sheik Abdiasis Abu Musab, said the group’s fighters had killed 30 people. “We killed 30 from the A.U. [African Union] and from the various forces of the so-called Somali government,” he said.

Al-Shabab’s estimate of the death toll was not independently verifiable.

Witnesses described seeing four bodies at the scene and a soldier fall from a rooftop after being shot.

The fighting continued for hours after the initial explosion, with gunfire and smaller blasts being heard around the parliament.

“We are behind the suicide bombing, explosions and the fighting inside the so-called Somali parliament house, and still heavy fighting is going on inside,” the al-Shabab spokesman said.

The African Union Mission in Somalia said in a statement that all the lawmakers who were in parliament before the attack were safely evacuated.

The attack on parliament, a building about 330 yards from the president’s palace that is guarded by A.U. peacekeepers and Somali forces, showed that the al-Qaeda-linked group remains capable of hitting the center of Mogadishu despite being pushed out of the capital two years ago.

“The terrorists have once again shown that they are against all Somalis by killing our innocent brothers and sisters. These cowardly, despicable actions are not a demonstration of the true Islamic faith,” said Prime Minister Abdiweli Sheik Ahmed.

The U.S. State Department strongly condemned the attack, offering condolences “to those affected by this heinous act of terrorism.”

Somalia’s government is struggling to impose a sense of order more than two decades after the fall of dictator Mohamed Siad Barre tipped the country into chaos.

In February, at least 11 people were killed when al-Shabab attacked the presidential compound. In April, it killed two lawmakers.

A Western diplomat who has worked with regional intelligence agencies said the attack would add to pressure on President Hassan Sheik Mohamud from about 100 members of parliament who last month called for him to be impeached over worsening security.

“The federal government is exercising no control,” the diplomat said. “Those . . . in parliament will start asking questions: What is this guy achieving?”

— Reuters