Somalia's Al-Qaeda-linked Shebab rebels launched a major suicide attack on Friday against the heavily-fortified presidential palace, home to the country's internationally-backed government, police and witnesses said.
A huge car bomb exploded at the perimeter of the central Mogadishu complex, and a group of around a dozen suicide attackers breached the Villa Somalia compound. Shebab rebels immediately claimed responsibility.
The UN's special envoy to Somalia said the country's president, Hassan Sheikh Mohamud, had telephoned to say he was unharmed in the attack against the complex, one of the best-defended locations in the war-torn country.
"Initial reports are that a suicide car bomber hit the gate and exploded, then men with guns followed," police officer Mohamed Ali told AFP. Another source said he saw at least nine gunmen attack.
An official source said Somalia's former deputy intelligence chief Mohamed Nur Shirbow and Mohamed Abdulle, a close aide to the prime minister, were among the dead.
"Desperate violent terrorists have staged a failed attack," National Security Minister Abdikarim Hussein Guled told reporters, as the complex was sealed off by Somali troops and soldiers from AMISOM, the African Union force fighting the Shebab.
"Things are back to normal and the security forces are in full control of the situation," he said.
A military spokesman for Shebab told AFP that the group was behind the attack.
"Our commandos have attacked the so-called presidential palace in order to kill or arrest those who who are inside. The enemy had suffered a great deal of harm," Sheikh Abdul Aziz Abu Musab said.
The attack came just a week after the militants carried out a suicide car bomb attack at the gates of Mogadishu's heavily-fortified international airport, and the Shebab spokesman said the hardline Islamist group wanted to show "that no place is safe for the apostate government".
"The airport, so-called presidential palace and anywhere in Somalia can be attacked as we plan," he warned.
Eyewitness Hussein Isa said the assault began with a huge car bombing.
"A suicide bomber rammed a car full of explosives into the perimeter wall of the presidential palace and another one with heavily armed men penetrated the area where the first one hit," he said.
The sound of intense gunfire and numerous explosions could be heard coming from the presidential complex before security forces brought the situation under control, AFP reporters said.
UN special envoy Nick Kay said the president "called me to say he's unharmed" and that the "attack on Villa Somalia had failed."
"The Somali people are tired of shootings, bombings and killings. It's time for a new chapter in Somalia's history and we cannot allow a slide back at this critical time," Kay said in a statement.
The attack comes amid an apparent upsurge of Shebab bombings in and around Mogadishu.
The group, who also carried last year's attack against the Westgate shopping mall in the Kenyan capital, once controlled most of southern and central Somalia but withdrew from fixed positions in the ruined coastal capital two years ago.
African Union troops -- including large contingents from Uganda, Kenya and Burundi -- have since recaptured the insurgent's main bases and tried to prop up Somalia's fledgling government forces.
But a string of devastating Shebab attacks against foreign and government targets have shattered hopes of a rebirth for the war-ravaged capital and demonstrated that the Islamist outfit's disruptive power was undiminished.