Militants wearing suicide vests and carrying guns and grenades have attacked the Somali presidential palace in Mogadishu. The country's president was reported unharmed, though others were killed.
A speeding car full of explosives rammed into a barricade erected by soldiers protecting the palace, causing an explosion and sending plumes of smoke into the sky.Gunmen chanting "God is great" then moved toward a second gate and tried to force their way into the complex.
Terrified civilians ran for cover as bullets flew past, with soldiers shooting in the air to disperse people and deter journalists coming to cover the attack.
As the gunfire intensified, a second blast was heard inside the palace, suggesting some militants had got inside.
The heavily guarded presidential palace is the residence of the country's president, prime minister and speaker of parliament.
"President just called me to say he's unharmed. Attack on Villa #Somalia had failed. Sadly some lives lost. I condemn strongly this terrorism," the UN representative to Somalia, Nick Kay, said on Twitter.
Casualty figures were not immediately known.
The al Qaida-linked group al-Shabab has been waging war in Somalia for years as it tries to oust a Western-backed government whose military is supported by African Union forces. Al-Shabab was ousted from Mogadishu in 2011, but the militants are still able to launch attacks on the seat of government as well as sites popular with foreigners.