MOGADISHU: Somalia’s Shabab rebels launched a major bomb attack and armed assault against the country’s presidential palace late Tuesday, penetrating the heavily-fortified complex and fighting a major gun battle with security guards.

An Al-Shabab spokesman said fighting was ongoing. Gunfire and explosions can be heard.

President Hassan Sheikh Mohamud is not at the palace. Security sources said Somalia’s internationally-backed President Mohamud, was unharmed and safe with guards from the African Union’s 22,000-strong AMISOM force.

“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.”

A Shabab spokesman said the group was behind the attack, and claim their commandos had managed to seize the president’s office inside the presidential compound known as the Villa Somalia.

“Our commandos are inside the so-called presidential office,” Shabab spokesman Abdulaziz Abu Musab told AFP. “We are in control of the headquarters of the apostate regime.”

“The enemy suffered high casualties during the operation, which is ongoing. The assault is a victory for us since the foreign installed government said that security was beefed up,” he added.

Witnesses said there was heavy gunfire and several blasts believed to be from 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 Shabab assault against the presidential palace in February. In May the insurgents also launched a similar attack against the national Parliament.

Al-Shabab group lost control of Mogadishu in 2011, but often carries out attacks in the city. The group has vowed to step up attacks during the holy month of Ramadan.

On Saturday, a suicide car bomb exploded near the Parliament, killing at least four people.

Our reporter says President Mohamud was attending a function at the residence of the UN special envoy to Somalia, near the airport.

A large contingent of the Somali military police accompanied him, leaving the presidential palace, known as Villa Somalia, mainly under the protection of African Union soldiers, he says.

The presidential palace is the seat of government and many top government officials live and work there.