Seven people, including two gunmen, were killed in an attack by the Islamist al Shabaab group on Criminal Investigation Department (CID) headquarters in Somalia on Sunday, police said.

The Islamist terror group Al-Shabaab claimed responsibility for the attack on the CID headquarters in Mogadishu.

The officials said the attackers started the assault with twin suicide car bombings at the gates of the security facility. The witnesses said heavy gunfire rang out inside for about half an hour after the first blast.

"We have confirmed seven dead including civilians and two militants," Ali Mohamed, a police officer, told Reuters.

Abdiasis Abu Musab , Al Shabaab's military operations spokesman, said one of its suicide bombers had started the attack by banging a car bomb into the building's gate.