Al-Qaida-linked militants detonated multiple bomb blasts and breached the main U.N. compound in Mogadishu on Wednesday, sparking gun battles with security forces that killed at least 12 people. U.N. personnel who reached the compound’s secure bunker all survived, though officials hinted not all reached that bunker.

An ambulance driver said that five Somali civilians were killed and an AP reporter who went inside the U.N. compound after the battle saw two bodies of what appeared to be al-Shabab attackers wearing Somali military uniforms. An official said seven attackers died in total.

Ben Parker, a spokesman for the United Nations Assistance Mission in Somalia, said that a first explosion was detonated at 11.30 a.m. and that at least two others followed. Dozens of staff from U.N. humanitarian and development agencies were in the compound and many moved to a secure bunker, he said.

African Union and Somali security forces responded and took control of the compound about an hour later. The U.N. staff who sought refuge in the bunker were then evacuated to the secure military base and airport complex across the street, Mr. Parker said.

A second U.N. official indicated an upcoming announcement of U.N. casualties. A third U.N. official said he believed four U.N. workers were killed, including one Kenyan, one Somali and two South Africans. The official said seven attackers died.

Several U.N. guards were believed to have also been wounded, or worse. Both U.N. officials insisted on anonymity because they are not official spokesmen.

Somali Prime Minister Abdi Farah Shirdon said he was appalled that “our friends and partners” at the U.N. who are carrying out humanitarian activities would be the victims “of such barbaric violence.”

Al-Shabab said on its Twitter feed shortly after Wednesday’s attack that its fighters “are now in control of the entire compound and the battle is still ongoing.”

An AP reporter at the scene said one of the three blasts included a car bomb that largely pulled off the compound’s front gate. Bullet marks could be seen on the inside walls.

The compound under attack lies just across the street from the secure airport complex, where African Union military forces are based. The U.N. compound is used by agencies like UNICEF, WHO and UNDP.

The top U.N. official on Somalia, Nicholas Kay, also works out of the building. He was not inside the compound when it was attacked.

More In: World | International | News