Somalia's new president, Hassan Sheikh Mohamud, survived an assassination attempt Wednesday when suicide bombers attacked the Mogadishu hotel where was living.
Mr. Mohamud was meeting with Kenyan Foreign Minister Samuel Ongeri, who was speaking to reporters when the bombers attacked.
The African Union force in Somalia says three suicide bombers attacked the hotel. Soldiers shot two of them who managed to set off their bombs. The third was shot and killed without his bomb going off.
President Mohamud and Foreign Minister Ongeri were unharmed, but at least three soldiers and several civilians were killed.
Militant group al-Shabab claimed responsibility for the bombings.
United Nations Secretary-General Ban Ki-moon strongly condemned the attack and said he is saddened that soldiers were killed. Mr. Ban said he is convinced that such acts will not weaken the determination of the Somali people to achieve peace and security.
Somalia's parliament elected Mr. Mohamud president on Monday. It was the last step of a U.N.-backed plan to bring a stable central government to Somalia.
Somalia has endured two decades of chaos and conflict since the last stable government collapsed in 1991. Last month, Somali leaders adopted a new constitution and installed a new federal parliament and speaker.