Libya's special forces clashed with armed activists in the city of Benghazi after the demonstrators attacked army and police buildings, an AFP journalist and witnesses reported.
The interim leader of Libya's army warned of the danger of a "bloodbath" as the unrest in the city flared up again a week after clashes killed more than 30 people.
At around 4:00 am (0200 GMT) heavy gunfire and explosions could be heard near the headquarters of the special forces, not far from the city centre, an AFP journalist and witnesses reported.
The Facebook page of the special forces said its members were exchanging light arms and rocket fire with an "outlaw" group and reported that two of its fighters had been wounded.
The clashes came just hours after dozens of protesters forced a brigade of former rebel fighters from their base in Benghazi on Friday evening.
The protesters had burned two vehicles belonging to the military, known as the First Infantry Brigade, before moving on the barracks, said a Libyan army officer.
The brigade was forced to quit its headquarters as the protesters took it over.
A witness on site said the protesters, some of whom were armed, had fired in the air and launched a rocket-propelled grenade at an external wall of the barracks, though nobody was hurt.
The brigade was set up by former rebel fighters who helped overthrow the regime of Moamer Kadhafi in 2011.
Late on Friday, Salem al-Konidi, the interim head of the army said on the Al-Aseema television channel: "If the special forces are attacked, there will be a bloodbath...
"There could be a catastrophe in Benghazi."
He said he did not know who had launched the attack or what their motive was.
He appealed to the city's elders and dignitaries to act to try to head off the unrest.