The Al-Qaeda linked Shebab militia claimed responsibility for the apparent twin suicide bomb attacks
Somalia's new president has been moved to a secure compound after surviving an assassination bid that dented hopes of change in the violence-scarred country and brought condemnation from the United States.
Hassan Sheikh Mohamud was the surprise winner of Monday's election in the poverty-stricken Horn of Africa nation that has been the battleground of warlords and Islamist militias for more than two decades.
The Al-Qaeda linked Shebab militia claimed responsibility for the apparent twin suicide bomb attacks on Wednesday outside the Mogadishu hotel where Hassan had been meeting a Kenyan delegation.
Hassan was unharmed in the attacks, but three soldiers -- two Somalis and a Ugandan from the African Union Mission in Somalia (AMISOM) -- were killed in what appeared to be an attack by multiple suicide bombers in security forces' uniforms.
The new president was transferred to Villa Somalia, a highly fortified complex home to several Somali institutions, AMISOM spokesman Colonel Ali Houmed said Thursday.
A Somali security official confirmed that Hassan was taken to the Villa, which still houses outgoing president Sharif Sheikh Ahmed.
The United States condemned the assassination bid, just days after voicing hopes that Hassan's election would usher in a new era for the troubled country.
"The United States condemns these attacks in the strongest possible terms and calls on all Somalis to refrain from inciting violence," Hilary Renner, spokeswoman for the State Department's bureau of African affairs, told AFP Thursday.
At home the violence also dampened the mood of cautious optimism that followed Hassan's election.
"It was a hit within an area where the African Union has had control for some time," a Western diplomat told AFP. "It reminds everybody there is still work to be done."
The Shebab, which has been waging a bloody insurgency against Somalia's Western-backed government, warned Tuesday that it considered illegitimate the UN-backed process which saw newly-designated lawmakers elect Hassan.
AMISOM troops have wrested control of most of Mogadishu from the Shebab in recent months, but the insurgent group has continued to attack foreign and government targets, mostly with suicide bombers.
Shebab has vowed its attacks will continue "until the liberation of Somalia", where Kenya, Ethiopia, Uganda, Burundi and Djibouti have all sent troops to support the government.
Two suicide bombers blew up at the gates of the Jazeera hotel and a third was shot by security forces while the new president was talking to journalists inside the hotel together with Kenyan Foreign Minister Sam Ongeri.
Western observers said they were surprised the new president was housed in a hotel -- just a few hundred metres from the capital's extremely well-protected airport, which is AMISOM's main base.
Hassan, who garnered 70 percent of the vote Monday, will remain at Villa Somalia with Sharif until the official handover Sunday.
Hassan was the first Somali president to be elected in Mogadishu since Siad Barre, whose ouster in 1991 plunged the country into civil war.
The various transitional presidents who have been in office since 2000 were all chosen in other countries for security reasons.
Hassan's election came after a long UN-backed political transition process aimed at restoring permanent institutions in Somalia, and it fuelled hopes that the country may be able to emerge from two decades of war.
The attacks underlined "what we all know, that Al-Shebab still have capabilities and presence in Mogadishu, and that game is not over yet," a European diplomat told AFP.