A member of the Libyan army stands guard along a street following clashes in Benghazi. File picture: Esam Omran Al-Fetori

Benghazi, Libya - Forces loyal to a rogue general clashed with former rebel Islamist groups in lawless Benghazi of eastern Libya killing at least 13 people on Friday.

The violence in what was the cradle of Libya's 2011 revolution comes weeks after the government acknowledged for the first time the existence of “terrorist groups” in the country and said it was mobilising against them.

Authorities have been avoiding a full-blown confrontation with the heavily armed ex-rebels who have bastions in Benghazi and other eastern regions, until they can bolster the army and police.

The clashes erupted after a group led by Khalifa Haftar, a retired general who led ground forces in the 2011 uprising that toppled dictator Moamer Kadhafi, pounded a barracks of the “February 17 Brigade”, witnesses said.

Warplanes backed up the attack on the Islamists who responded with anti-aircraft fire.

The two groups also fought pitched battles in Sidi Fradj, south of Benghazi, an AFP journalist said, and witnesses said Haftar's men seized the headquarters of Rafallah al-Sahati militia.

Medical sources at Al-Marj hospital, east of the city, where Haftar's casualties were taken, said four bodies and 60 wounded were brought in.

Benghazi hospitals gave a toll of nine dead and around 40

wounded, without identifying them.

The fighting subsided in the afternoon, an AFP journalist said, as witnesses reported that Haftar's forces were pulling back south to Sidi Fradj.

Haftar heads a group calling itself the “National Army” which launched “a large-scale operation to flush terrorists out of Benghazi”, said a spokesman, Mohammed al-Hijazi.

“This is not a civil war. It's an operation against terrorist groups,” said Hijazi, who like Haftar was a former officer in Kadhafi's army before defecting.

Libya's armed forces chief of staff, Abdessalam Jadallah al-Salihin, denied any army involvement in the Benghazi clashes.

“The (regular) army has nothing to do with the clashes. The army did not give any orders for any sort of operation” in Benghazi, he said.

Salihin admitted, nevertheless, that some officers and units from the regular army had joined Haftar's group.

Prime Minister Abdullah al-Thani denounced Haftar's forces as “outlaws” and told a news conference in Tripoli that the army was “in control on the ground”, urging restraint in Benghazi.

As the fighting raged, Algeria closed its embassy and consulate in Tripoli, saying it had received a “real and imminent threat” to its diplomats and staff.

The foreign ministry in Algiers said the decision, which comes after a wave of abductions and attacks targeting foreign diplomats, was taken in coordination with Libyan authorities.

There was no mention of the violence in Benghazi.

But the clashes in the Mediterranean city underscore the government's struggle to rein in former rebels who helped topple Kadhafi nearly three years ago.

The city has been rocked by almost daily attacks that have killed dozens of members of the security forces, judges and foreigners.

There have been no claims of responsibility but Islamists have been blamed for the bloodshed.

In March, the government issued a statement blaming “terrorists” for dozens of deadly attacks and vowed to eradicate these groups.

Its pledge came after Haftar, in a video posted on the Internet, announced an “initiative” under which the interim government and parliament would be suspended in preparation for elections.

That video sparked rumours on social media that a coup might be in the offing.

The government, which has come in for criticism for failing to defeat lawlessness in Libya, was quick to quash the rumours and insist it was in control.

Weeks later it declared a “war against terrorism”. However, no concrete measures have been taken.

Attacks against the army have spurred tribesmen, soldiers and some ex-rebels to join forces with Haftar against the jihadists.