Gunmen killed two policemen in Benghazi in eastern Libya on Saturday, a security source said, a day after the army had vowed to restore order in the port city hit by bombings and assassinations.
Security in Benghazi, an important part of Libya's oil infrastructure, has deteriorated in the past few months with militants and Islamists roaming unchallenged, highlighting the upheaval two years after the fall of Muammar Gaddafi.
On Friday, army commanders announced they would no longer tolerate security violations and special forces were deployed across the city of 1 million inhabitants.
But on Saturday night unknown gunmen killed two policemen on patrol as they were driving back to police headquarters, a security source said. The attackers fled.
In separate violence, the head of a court in Derna, a city east of Benghazi, was killed by a bomb under his car as he was leaving his house, another security source said.
Most countries have closed their consulates in Benghazi after a series of attacks and some foreign airlines have stopped flying there. The U.S. ambassador and three other Americans were killed in September 2012 during an Islamist assault on the consulate.
Stability in the region is key for oil supplies because about 60 percent of Libya's oil production comes from its eastern half.
Western powers worry that instability in Benghazi will spill over to the capital Tripoli, which this week has seen the worst fighting in months between militias.
Protests and strikes over higher pay and political rights have shut down much of the country's oil output, depriving the government of its main source of income.