By Abdi Sheikh
MOGADISHU (Reuters) - Islamist militants carried out a deadly assault on the main U.N. compound in the Somali capital on Wednesday, dealing a blow to fragile security gains that have allowed a slow return of foreign aid workers and diplomats.
The assault, claimed by Islamist group al Shabaab, began before midday when a car bomb exploded outside the United Nations Development Programme (UNDP) base. Rebel gunmen forced their way into the compound and fought with security guards.
The African Union (AU) peacekeeping force, which sent soldiers and armored vehicles to the compound, which includes several buildings, said it was under the control of friendly troops after a gun fight that lasted more than 90 minutes.
Interior Minister Abdikarim Hussein Guled said four foreign U.N. security staff and four local guards were killed in the gun battle that left seven insurgent fighters dead.
An ambulance service official said his crew carried away seven dead civilians, bringing the total dead to 22.
It was the first significant attack on U.N. premises by al Shabaab since they were driven out of Mogadishu in fighting with AU and Somali government forces about two years ago.
More than a million Somalis live in crisis conditions, according to the United Nations, which has started building up offices and international staff after security improved.
U.N. Secretary-General Ban Ki-moon said he was "outraged by the despicable attack" in a telephone call to Somali President Hassan Sheikh Mohamud. Al Shabaab accused the United Nations of serving U.S. interests.
"The U.N., a merchant of death and a satanic force of evil, has a long, inglorious record of spreading nothing but poverty, dependency and disbelief," al Shabaab said on its Twitter feed @HSMPRESS1
The South African state weapons firm Denel said two of its staff were killed in the raid. Militants have launched grenade strikes and similar low-level attacks on U.N. bases in the past, but no assault of this scale.
"HERE TO STAY"
One U.N. official said some Western nations that had been keen to support the Western-leaning government elected last year had played down dangers posed by al Shabaab and its ability to infiltrate the security forces and attack the capital.
"This is part of the consequence of over-optimism in some Western nations that has overshadowed the need to look at deeper problems before rolling out any kind of U.N. mission," said the official, who follows Somalia closely but is not authorized to talk to the media.
He said the government had not done enough to overhaul its security forces.
The top U.N. official in Somalia, Nicholas Kay, told Reuters there were lessons to be learned but that the United Nations would not be deterred from its mission.
Asked if U.N. staff would be evacuated from Mogadishu, Kay said: "No. The U.N. is here to help and we are here to stay."
The initial bomb blast sprayed masonry and twisted metal across the road that links the nearby airport, which serves as the main base for the AU peacekeepers, and the city center.
The Somali government condemned the attack and offered "deepest sympathy to all victims".
"Today all Somalia stands shoulder to shoulder with UNSOM," Prime Minister Abdi Farah Shirdon Saaid said on Twitter, referring to the new U.N. Somalia assistance program UNSOM.
Bystanders reported several smaller blasts inside the compound during the gunfight.
The raid was a copycat of a strike on Mogadishu's law courts in April, when gunmen detonated suicide vests during a gunbattle with security forces. Interior Minister Guled confirmed some of the assailants blew themselves up on Wednesday.
AU forces and government troops drove al Shabaab rebels out of the coastal capital in 2011, but militants have kept up guerrilla-style attacks from rural bases.
The overthrow of a dictator in 1991 plunged Somalia into two decades of violent turmoil, first at the hands of clan warlords and then Islamist militants, who have steadily lost ground since 2011 under pressure from the AU military offensive.
(Additional reporting by Tom Miles in Geneva, Drazen Jorgic and Edmund Blair in Nairobi, Tosin Sulaiman in Johannesburg amd Michelle Nichols in New York; Writing by Richard Lough; Editing by Michael Roddy)