MOGADISHU, Somalia (AP) -- Nine al-Shabab militants wearing military fatigues and carrying guns and grenades died after attacking the presidential palace with two car bombs on Friday, in an assault the president called a "media spectacular" by a "dying animal."
President Hassan Sheikh Mohamud was unharmed, but two government officials were killed, the interior ministry said.
The attack underscores a worrying new trend in Mogadishu: That despite a period of relative calm following al-Shabab's ouster from Mogadishu in August 2011, militants have carried out a series of deadly assaults in recent weeks that have seen the city hit with mortar fire and pitched battles.
Weapons meant for the Somali army could have been used by the militants in Friday's attack. A confidential U.N. Monitoring Group on Somalia and Eritrea reported this month that the country's military is selling weaponry in markets where the al-Qaida-linked militants buy weapons.
In at least one case weapons were sold by a military commander directly to an al-Shabab commander, the confidential report said.
Friday's attack against the compound where the president and prime minister live began with a car bomb explosion, followed by an assault by gunmen on palace guards, said police Capt. Mohamed Hussein. Al-Shabab, an al-Qaida-linked group, claimed responsibility.
"President just called me to say he's unharmed. Attack on Villa #Somalia had failed. Sadly some lives lost. I condemn strongly this terrorism," the U.N. representative to Somalia, Nick Kay, said on Twitter. He added later: "The Somali people are tired of shootings, bombings and killings. It's time for a new chapter in Somalia's history."
The Interior Ministry displayed the seven bloodied and dead bodies of the attackers and said two others blew themselves up. The wreckages of two car bombs lay nearby.
The two others killed included a former intelligence commander and an aide to the prime minister, a Somali-American named Mohamud Hersi Abdulle, said Hussein.
"Apart from media headlines, #Shabaab will achieve nothing from it," a Twitter account run by the office of Hassan Sheikh Mohamud said. 'Don't be fooled by this "media spectacular'. This is another act of desperation from a dying animal."
Al-Shabab has been waging war in Somalia for years as it tries to oust a Western-backed government. Weakened from its apex of power, the militants are still able to launch vicious attacks.
U.N. Secretary-General Ban Ki-moon condemned the attack "in the strongest terms" while the U.N. Security Council said it was "appalled." Both paid tribute to Somali and African Union forces for repelling the attack.
The Security Council reaffirmed "that this and other acts of terrorism would not weaken their determination to support the peace and reconciliation process in Somalia."
The secretary-general expressed concern that recent attacks by al-Shabab "are clearly aimed at destabilizing the country at a time when many efforts are being mobilized to restore peace and development," U.N. deputy spokesman Farhan Haq said.
The U.N. Monitoring Group report, published Feb. 6 and obtained by The Associated Press, found that many weapons given to Somalia's military can no longer be accounted for, including rocket-propelled grenades, hand grenades and bullets. The Monitoring Group "has developed serious concerns that the 1,000 AK-47s delivered from Uganda" are no longer in government control, it said.
The report said that two separate clan-based power bases in the government are procuring weapons with a clan-based agenda that works against peace in Somalia, including by distributing weapons to clan militias. A sub clan of the president's dominates weapons procurements and funnels them to Abgaal militia forces, it said.
"In addition, the Monitoring Group has also obtained documentary evidence corroborating information that a key advisor to the President, from his Abgaal subclan, has been involved in planning weapons deliveries to Al-Shabab leader Sheikh Yusuf Isse 'Kabukatukade', who is also Abgaal," the report said.
The report also said that ammunition supplied to Somalia's army have been leaked in large quantities to arms markets. Weapons and ammunition not sold at a market during the day are taken back for storage in garages and houses owned by Somalia army officers, the report said.
"Al-Shabaab are known to frequent the market to purchase weapons and ammunition and were easily identifiable by the salesmen there," the report said.
Somalia's government has not responded publicly to the report and did not immediately respond to a request for comment Friday.
Ken Menkhaus, a Somalia expert at Davidson College, wrote in a new paper on al-Shabab being published Monday in the CTC Sentinal, Westpoint's anti-terrorism publication, that al-Shabab has been weakened as a political movement and will not be able to establish an Islamic state, but that it's secret service -- "Amniyat" -- can still unleash devastating attacks against African Union forces and the Somali government.
In Friday's attack, a speeding car full of explosives rammed into a barricade erected by soldiers protecting the presidential palace, causing an explosion and sending plumes of smoke into the sky. Amid the mayhem, gunmen chanting "God is great" then moved toward a second gate and tried to force their way into the complex.
Straziuso reported from Nairobi, Kenya.
Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.