"Armed brigades of Ansar al-Sharia and other criminal groups attacked the complex with both light and heavy weaponry," a government statement said.
The jihadist group Ansar al-Sharia was placed on the US terror list in January.
It said nine special forces members were killed and that other soldiers and policemen were wounded.
Some attackers were killed or arrested, the statement said without elaborating.
Special forces intervened to try to evict the gunmen, triggering fighting elsewhere in the eastern city that also wounded 24 members of the security forces, the medical sources said.
The officer said gunmen attacked the headquarters early today. Blasts and gunfire rocked the Mediterranean city for two hours from 0100 GMT, witnesses said.
The officer told AFP that four of the soldiers killed died as they were heading back to barracks after the fighting had subsided.
He said "tension" was running high among army units in Benghazi.
Another security source said earlier the gunmen had been trying to seize a vehicle packed with weapons and ammunition that the police had taken from them.
Today's violence comes just days after a car bomb targeted a special forces barracks in Benghazi, killing two soldiers and wounding three.
The government has been struggling to consolidate control in the vast and mostly desert country, which is effectively ruled by a patchwork of local militias and awash with heavy weapons looted from Kadhafi's arsenals.
The lawlessness has also extended to the capital.
On Tuesday, gunmen stormed the parliament building in Tripoli, forcing lawmakers to postpone a vote for a new prime minister to replace Abdullah al-Thani.
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
