A police official in the eastern Libyan city of Benghazi said protesters and suspected Islamic militants had gathered outside the compound to demand the release of a man being held in connection with the assassination last month of the head of one of the city's security agencies, National Security Chief Col. Farag el-Dersi.
Some in the crowd opened fire on the compound during the protest and clashed with police, the security official said. Assailants then launched a rocket-propelled grenade on a military vehicle that was sent to the scene. The official spoke on condition of anonymity in line with regulations.
The official said two civilians, a suspected Islamic militant and police officer were killed. Nine people were wounded, including the head of a powerful militia aligned with the military.
In Benghazi, where the revolt that unseated longtime ruler Moammar Gadhafi began last year, security has sharply deteriorated over the past year.An attack in September on the U.S. Consulate in Benghazi killed U.S. ambassador to Libya Chris Stevens and three other Americans.
Thursday's attack takes place just four days after four policemen were shot dead when militants attacked the same security compound. The unknown assailants attacked the security compound in an apparent attempt to break into a nearby detention center where the suspect in el-Dersi's killing is being held.