Al Qaeda-linked militants al Shabaab attacked the Somali presidential palace compound on Friday, blasting through a gate with a car bomb and engaging in a fierce gun battle with African peacekeepers, police said.
Somali Islamist militant group al Shabaab claimed responsibility for the attack on the heavily fortified compound in Mogadishu, known as Villa Somalia, but the Somali president Hassan Sheikh Mohamud was unharmed, Reuters reported.
"President just called me to say he's unharmed. Attack on Villa Somalia had failed. Sadly some lives lost," U.N. Special Representative Nick Kay wrote on his official Twitter feed.
It was not immediately clear how many people were killed.
In the past few weeks, Mogadishu has been hit by a series of suicide bomb attacks claimed by al Shabaab, who were pushed out of the city in mid-2011 but have continued to wage a sustained guerrilla campaign.
Friday's battle took place at the house of Somalia's top military commander, General Dahir Aden Indha Qarshe, located in the same compound and near the presidential palace building, Abdikadir Ahmed, a senior police officer, told Reuters.
"The al Shabaab fighters who attacked the palace were about ten men in military uniform and the red hats [worn by the palace guards]," Hussein Farah, a senior police officer at the scene, told Reuters.
"They had three cars. One was a car bomb and the other cars were carrying well-armed fighters," he said.
"All the Shabaab fighters perished, some blew up themselves while others were shot dead. Several government guards also died. Now the fighting is over, and scattered on the scene is human flesh and blood."
At least seven Somalis were killed when a remote-controlled bomb aimed at a U.N. convoy tore through cars and tea shops just outside the capital's international airport last week.