MOGADISHU - Heavily armed militants launched a major bomb attack and armed assault against Somalia's heavily-fortified presidential palace late Tuesday, police and witnesses said.
The sources said President Hassan Sheikh Mohamud was unharmed and safe with guards from the African Union's 22,000-strong AMISOM force.
The internationally-backed president was not inside the presidential palace at the time of the attack, according to security sources.
Meanwhile, the attack has ended with at least nine of the attackers killed, a security official told AFP.
"There were at least nine attackers, all have been killed, and the situation is under control, the attack is over," security official Abdi Ahmed said.
"There were eight blasts towards the end of the fighting, believed to have been suicide vests. They detonated themselves."
The attack bore all the hallmarks of Somalia's Al-Qaeda-linked Shebab rebels, who have launched a string of strikes against the country's internationally-backed but fragile government.
"There was an attack on the presidential palace, with gunmen attacking a checkpoint at the rear of the compound," police officer Ali Hussein told AFP.
"There was a major explosion and security forces are fighting them," he added, without confirming if the insurgents had managed to enter the city centre compound, known as the Villa Somalia.
Witnesses said there was heavy gunfire and several heavy blasts believed to be grenades.
"Bullets are flying around coming from the palace," said Halimo Nure, who lives close to the compound, one of the most heavily defended areas of the city. "There is shooting and gunfire, there are also explosions like they are using grenades."
The attack appeared to be a repeat of a Shebab assault against the presidential palace in February. In May the Islamist insurgents also launched a similar attack against the national parliament.
Also related to this story
Somalia security chief resigns after attack
Ugandan peacekeepers killed during Somalia attack
Security Council 'outraged' by attack on Somali parliament
Somalia declares new war on al-Shabaab