Clashes between Libyan elite forces and gunmen Saturday killed five soldiers in Benghazi, the army said, in the latest bout of unrest as the government struggles to control rebels from the 2011 uprising.
The interim leader of Libya's army warned of the danger of a "bloodbath" as the unrest in Benghazi flared again a week after violence killed more than 30 people in the eastern city.
Explosions and heavy gunfire could be heard at about 4:00 am (0200 GMT) near the headquarters of the special forces and in Al-Lithi district on the road to the airport, not far from the city centre, an AFP journalist and witnesses reported.
The special forces said on Facebook that its members exchanged light arms and rocket fire with an "outlaw" group.
They reported three of its members were shot dead and two wounded as they "were defending the legitimacy of the state with courage and honour".
Then soon after they announced two soldiers had been "liquidated" by "the takfir group", in a clear reference to Islamist extremists.
The special forces warned that "they would target anyone who shot at them".
Benghazi, the cradle of the uprising that ousted Moamer Kadhafi's regime in 2011, has become increasingly marred by clashes between militias made up of former rebels who fought the late dictator's forces and the still infant regular forces of the new authorities.
Militias with different tribal and ideological links now control parts of Benghazi, where there has been a wave of attacks on army and police officers and facilities.
Islamists have often been blamed for attacks in Benghazi, but some observers say militias in general have launched attacks in a bid to stop regular security forces from regaining control of the city, despite local opposition.
Radical Islamists were blamed for an attack on the US consulate in Benghazi on September 11 last year that killed four Americans, including ambassador Chris Stevens.
The latest 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 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 and says it takes its orders from the defence ministry.
The attackers later attacked a police station, the offices of border guards and facilities and another office building of the First Infantry Brigade, witnesses said.
Following that first attack, Salem al-Konidi, the interim head of the army warned "there will be a bloodbath" if the special forces are targeted.
"There could be a catastrophe in Benghazi. If they have demands, they can wait until (Saturday). We can discuss with them."
He said he did not know who had launched the attack or what their motive was, but appealed to elders and dignitaries to act to try to head off the unrest.
Konidi is the interim replacement for General Yusef al-Mangoush, who resigned last Sunday, a day after fighting in Benghazi killed 31 people and left dozens more wounded.
He had come under mounting criticism for having failed to form a national army in the face of resistance from militias unwilling to surrender their independence.
In last week's violence, armed demonstrators opposed to the city's militias attacked the pro-Islamist "Shield of Libya" brigade at its barracks.
The Shield of Libya is mostly made up of rebels who battled Kadhafi in 2011, and is also under defence ministry control.
The new authorities, who are struggling to form a professional army and police, regularly use these former rebels to secure the borders or to intervene in tribal conflicts.
The new government has failed to disarm and disband the former rebel groups who implement the law the country and are trying to legitimise some of them despite the opposition of a majority of the population.