AN Islamist militant killed two soldiers at the gates of the presidential palace in Mogadishu, Somalia.
The suicide bomber persuaded Somali government officials that he had defected, then walked up to the president's palace compound today and blew himself up near the gates.
Palace officials said Somali President Hassan Sheikh Mohamud was abroad at the time and Prime Minister Abdi Farah Shirdon Saaid, whose house was near the site of the explosion, was not injured.
The attack was a reminder of the threat still posed by al Shabaab, even after African peacekeepers pushed it out of the capital last year and forced it to retreat to the south.
It was the first explosion reported this year in Mogadishu, where the fragile government is struggling to impose any sense of order more than two decades after the fall of dictator Siad Barre tipped the country into chaos.
Government officials said the attacker, Ali Abdi Hared, told them he had defected from the rebels and went on to join the country's security services on January 14.
Hared frequently visited the palace guards and was given an official pass to the palace, officials and guards at the scene said.
The government had been "rehabilitating and investigating" Hared, Somalia's information minister, Abdullahi Ilmooge, said "The bomber was a national security soldier. The bomber had defected from al Shabaab," he added.
When Hared walked up this morning, the guards said they carried out a routine check and found he was wearing an explosive jacket.
The guards tried to prevent him from detonating his device, but it went off. "The man blew up himself near a wall between the Ethiopian embassy and the Somali PM's residence," Ahmed Ali, a Somali soldier at the presidential palace said.
"One guard died there and then. Another died of his wounds. They were all the guards of the prime minister," he added.
Al Shabaab - which wants to impose its strict version of Islamic law, or Sharia - said it killed seven soldiers in the attack and warned there would be more to come.
"The operation is part of a renewed campaign of attacks against Western puppets in Somalia, reminding them that the Mujahideen will get into them, whatever security precautions they take," the movement said in a statement.
Al Shabaab pulled back to southern Somalia after quitting Mogadishu. In late September Kenyan troops forced it to withdraw from the port of Kismayu, its last major urban stronghold in the Horn of Africa nation.
On Jan. 17 the group said it had executed a French captive after a French commando mission to rescue him failed.
Somalia's president and prime minister were elected last year in the country's first national vote since Siad Barre's overthrow in 1991.