Witnesses said the huge explosion damaged nearby buildings and gunfire could still be heard near the mayor's office

Mogadishu (AFP) - At least six people were killed on Sunday in an attack by Al-Shabaab militants at the mayor’s office in central Mogadishu, police said.

A suicide bomber set off a huge blast that tore through building near the office complex with gunfire erupting afterwards, Somali police spokesman Sadik Dudishe said at the end of the four-hour siege.

“All the six attackers died. Five of them during the fire exchange with the security forces and one of them detonated himself,” Dudishe told reporters.

“Six civilians also died during the attack and the situation is back to normal.”

All the staffers at the mayor’s office were rescued, the police added.

Al-Shabaab, a militant group allied with Al-Qaeda claimed, responsibility for the attack via its communication channels, saying its fighters “made their way inside the targeted building after killing the security guards.”

Witnesses said the initial explosion damaged nearby buildings and gunfire could be heard in the vicinity of the mayor’s office.

The area was quickly cordoned off by security officers, a witness who runs a business near the offices said.

Another witness, Omar Nur, said he was inside a nearby mall when the explosion went off and “was lucky to have escaped safely.”

The Al-Shabaab militants have been waging a bloody insurgency against the frail internationally backed central government for 15 years, carrying out attacks both in Somalia and neighbouring countries.

- Major offensive -

The latest attack comes days after seven soldiers were killed on Friday at a military camp in Galcad, a town in central Somalia about 375 kilometres (230 miles) north of the capital Mogadishu.

The US military said on Saturday the attack – in the Somali town retaken by the army this week – involved more than 100 Al-Shabaab jihadists.

'There is gunfire going on inside the vicinity of the main building but we don't know what is happening inside,' a witness said

“The combined actions by partner forces on the ground and the collective self-defence strike is estimated to have resulted in three destroyed vehicles and approximately thirty al-Shabaab terrorists killed” the US military command for Africa (AFRICOM) said in a statement.

In recent months, the Somali army and local clan militias have mounted a major offensive against the jihadist group, retaking swathes of territory in the centre of the country in an operation backed by US air strikes and an African Union force.

But despite the gains by the pro-government forces, the offensive has drawn retribution and the militants have continued to demonstrate the ability to strike back with lethal force against civilian and military targets.

On Tuesday, Al-Shabaab launched a deadly attack on a military base in another part of central Somalia, just a day after the government claimed a “historic victory” over the jihadists.

Last week, eight people were killed in a roadside bombing claimed by Al-Shabaab in central Somalia, police said. Earlier this month, 19 people were killed in twin car bombings in Mahas, a town in Hiran district in Hirshabelle.

Although forced out of Mogadishu and other main urban centres more than a decade ago, Al-Shabaab remains entrenched in parts of rural central and southern Somalia.

In the deadliest Al-Shabaab attack since the offensive was launched last year, 121 people were killed in two car bomb explosions at the education ministry in Mogadishu in October.

The group has also been active recently across the border in eastern Kenya, which is a contributor to the African Union force in Somalia, carrying out several deadly small-scale attacks.