The building targeted is located in the supposedly tightly secured coastal district of Tawahi that hosts intelligence and political police headquarters, a naval base and a presidential residence.
"A group of assailants attacked the northern part of the building, and some of them climbed the wall into the building, while others blew up a bomb-laden car at the entrance located in the west of the premises," a security official said.
"Six soldiers, three attackers and two passers-by were killed in clashes" that followed what was a two-pronged attack, a military official said.
No information was immediately available on the number of attackers.
More From This Section
The official Saba news agency quoted a security official as saying the incident was "a suicide terrorist attack by al-Qaeda."
"The guards at the HQ have foiled this cowardly attack" and government forces were still "hunting down the attackers who fled after the assault," the official told Saba.
The brazen attack on such a highly protected area came despite the authorities having stepped up measures in recent weeks to contain a deadly wave of violence rocking the Arabian Peninsula country for years.
Qahtan's successor, Abdo Tareb, ordered the dismissal of three security chiefs for failing to prevent a March 24 attack attributed to al-Qaeda on an army checkpoint in the southeastern Hadramawt province, in which 20 soldiers were killed.
Today's assault is similar to one carried out by gunmen from al-Qaeda-affiliated group Ansar al-Sharia on an army headquarters in Hadramawt in September, in which they took hostages and 12 people died.
The army recaptured the facility and freed the hostages after nearly four days of fighting.
The group has taken advantage of the weakening of the central government since 2011, as a result of a popular uprising that toppled president Ali Abdullah Saleh after 33 years in power.
Washington regards al-Qaeda in the Arabian Peninsula as the global jihadist network's most dangerous affiliate and has stepped up drone strikes against the group in recent months.