A large explosion, which police sources said they believed was a car bomb, was followed by a fierce exchange of gunfire. Police sources said the style of attack bore all the hallmarks of the Al-Qaeda-linked Islamist Shebab militia.
The facility, which contains a high-security prison, is located close the Villa Somalia, the complex that houses the office of Somalia's internationally-backed President Hassan Sheikh Mohamud.
The Villa Somalia was hit by a similar attack in July, when a car bomb was detonated and Shebab fighters stormed the complex before blowing themselves up.
The presidential palace was also attacked in a similar fashion in February, while the parliament complex was hit by a coordinated bomb and gun attack in May.
Shebab rebels have continued to target key areas of government or the security forces, in an apparent bid to discredit claims by the authorities -- who are backed by the African Union's 22,000-strong AMISOM force -- that they are winning the war against the Islamist fighters.
The latest attack also comes a day after AU forces claimed to have liberated a former Shebab stronghold in Somalia as part of a joint offensive with government troops aimed at capturing key ports from the Islamist fighters and cutting off a key source of revenue for the rebels.