A suicide bomber has detonated explosives inside Somalia's presidential palace compound, killing two people.
The man blew himself up when he was questioned by soldiers manning a checkpoint in the palace complex known as Villa Somalia, said Mohamed Ali, a police officer at the official residence in the capital Mogadishu.
Villa Somalia has a large compound with several buildings and checkpoints. The bomber was four more checkpoints away from President Hassan Sheikh Mohamud's home, Ali said. The president is said to be out of the country on state business.
The checkpoint where the blast took place is near the home of Prime Minister Abdi Farah Shirdon which is also in the compound.
Two soldiers died and three others were wounded in the explosion, said Yusuf Abdi, a military officer at the palace.
Mohamud survived an assassination attempt on his second day in office in September when two suicide bombers blew themselves up while trying to gain access into a heavily guarded hotel serving as his temporary residence.
No one has claimed responsibility for the attack but it falls into a pattern of previous attacks blamed on the al Qaida-linked rebel group al-Shabab. The extremist group has been waging an insurgency against Somalia's United Nations-backed government.
Mohamud, 56, who was an academic and activist before becoming president, is expected to form the county's first functioning central government since 1991, when warlords overthrew long-time dictator Mohamed Siad Barre.
Since 2004, Somalia has been represented by a UN-approved leadership structure called the Transitional Federal Government that until recently only controlled small parts of Mogadishu.
Since African Union and Somali troops pushed the al-Shabab extremists out of the capital in 2011 and most parts of the country they occupied in 2012, positive momentum for new stability is building.