By Ayman El-Warfalli and Ferus Bosalum
BENGHAZI (Reuters) - Libyan irregular forces backed by helicopters clashed with Islamist militias in Benghazi on Friday in fighting that left at least 12 people dead and posed a new test to the country's fragile government.
Irregulars of the self-declared Libyan National Army, led by retired General Khalifa Haftar, shelled bases belonging to Ansar al-Sharia and another Islamist militant group in Benghazi, said Mohamed Al-Hejazi, a spokesman for Haftar's forces.
The violence prompted Libya's prime minister to order the regular military to control any armed groups - including Haftar's forces - in the eastern city, where militants often clash with the army, and assassinations and bombings are common.
Since the 2011 civil war that ousted Muammar Gaddafi, Libya has been in political turmoil and the government has been unable to impose authority over brigades of former rebels who refuse to disarm and have carved out regional fiefdoms.
In another sign of turmoil, Algeria sent a team of special forces to evacuate its ambassador and embassy staff from Libya in a military plane after a militant threat to its embassy, officials and a security source said on Friday.
Benghazi, the cradle of the NATO-backed uprising against Gaddafi, in particular has struggled to curb violence and stem attacks blamed on Ansar al-Sharia, which often operates openly despite being designated a terrorist organization by Washington.
Libya's army chief of staff told state television he had given no orders for any regular military units to attack bases in Benghazi.
Hours later, Prime Minister Abdullah al-Thinni told reporters: "We have given orders ... to intercept any force trying to enter Benghazi because they don't have legitimacy from the state."
The city was calmer in the afternoon after the clashes in the morning, when witnesses said at least one regular army helicopter had been used in some of the assaults on the Islamist bases.
At least 12 people were killed and another 50 injured in the fighting, medical sources at a local hospital said.
Hejazi dismissed the government's rejection of the legitimacy of Haftar's forces and said they were forcing militants from their bases into the city because the government had failed to help Benghazi.
"We're telling them we have the legitimacy from the civilians who suffer on a daily basis from the killings targeting the police and military," he said. "We are fighting militias who threaten stability."
Haftar, a leading figure in the anti-Gaddafi revolt, in February stirred rumors of a coup by appearing in military uniform to call for a presidential committee to be formed to govern until new elections.
It was not clear how much support he commands in the country's nascent army, which is still in training. Tripoli's government in February said he had no authority and threatened legal action against him.
But the government is fragile and the parliament almost paralyzed by rivalries, with little progress to full democracy made since 2011. A planned new constitution is still unwritten and the country is on its third prime minister since March.
U.S. and European countries are helping build up a regular army but Libya's armed forces and government cannot control the brigades of ex-rebels and militants who once fought Gaddafi.
The North African nation's vital oil export industry has suffered badly and is often targeted by armed protesters seeking a greater share of oil wealth, federalist power for the regions or just better basic services.
Since last summer, armed protesters have repeatedly closed down ports and oilfields, bringing production down to around 200,000 barrels per day from the 1.4 million bpd that the OPEC member state produced before the protests erupted.
(Additional reporting by Ahmed Elumami; Writing by Patrick Markey; Editing by Andrew Roche and Pravin Char)