Al-Qaida-linked militants attacked Somalia's presidential palace Friday. The president was unharmed but at least 17 others were killed.
Al-Shabab quickly claimed responsibility for the attack on the palace, known as Villa Somalia.
Witnesses say the attack began with a car bomb explosion, followed by between 15 and 20 gunmen storming the palace compound. African Union and Somali government soldiers fought off the assailants.
A Somali security official tells VOA that the dead include seven soldiers, at least eight attackers and two others. One of those killed, Mohamud Indha-Asse, was chief of staff in the prime minister's office.
Nick Kay is the U.N. secretary-general's special representative to Somalia. He says he heard from President Hassan Sheikh Mohamud soon after the attack.
"The first I heard of it this morning actually as a phone call from the president just after the attack had happened. He wanted to reassure me that he was unharmed, unhurt and that the attack had been unsuccessful."
In a statement, President Mohamud sent condolences to the families of those killed, and vowed that the Somali government and African Union forces would "eliminate" the group.
Al-Shabab lost control of Mogadishu in 2011 but has mounted periodic attacks in the city.
The U.N.-backed Mohamud government is trying to restore stability to Somalia, which has endured more than two decades of lawlessness and war.