1 of 2
Mohammed El-Sheikhy, Associated Press
In this Monday, Nov. 3, 2014 photo, Libyan military soldiers inspect a damaged empty site that was used by Islamic militias during heavy clashes in Benghazi, Libya. Clashes in Benghazi have killed at least 210 people since government troops backed by armed civilians started a campaign in mid-October to retake the city from Islamist militias.

TRIPOLI, Libya — In a blow to anti-Islamist factions, Libya's highest court on Thursday ruled that general elections held in June were unconstitutional, and that the country's parliament and government which resulted from that vote should be dissolved.

The development further deepened the rift in the politically divided Libya, which has been mired in months-long bitter clashes and turmoil that have left the country with two rival parliaments and governments, killed hundreds and displaced whole populations of war-torn cities and towns.

The Supreme Constitutional Court issued its ruling from the capital of Tripoli, which is controlled by Islamist-allied militias from the powerful western coastal city of Misrata.

The militias, which took Tripoli in August, revived an earlier parliament that ran the country before the elections. They also forced the recently elected parliament, dominated by anti-Islamists, to convene in the far eastern city of Tobruk.

The fact that Libya's top court ruled from Tripoli raises the question whether it did so under pressure from the militias. The ruling declared illegal a March amendment to the country's transitional constitution that laid out the roadmap to the June elections, hence effectively rendering the parliament and government that followed the vote also illegal.

The Tobruk parliament convened following Thursday's ruling but it was unclear if lawmakers would officially reject it.

Abu-Bakr Baeira, a leading lawmaker in the Tobruk parliament, described the court's decision as "politicized" and warned it would only further partition Libya.

"Tripoli is hijacked," Baeira, who is a strong advocate for setting up a semi-autonomous region in eastern Libya, told The Associated Press over the phone from Tobruk. "We don't recognize anything that comes out of it."

The parliament's deputy speaker, however, hailed the ruling as a "victory for the nation." Saleh al-Makhzoum said it had rendered the Tobruk parliament "nonexistent."

In Misrata, rallies were held, complete with fireworks, to celebrate the ruling.

Former lawmaker and historian Faraj Najm said the ruling resets Libya "back to square one" and that the choices now before the Tobruk-based parliament are "between bad and worse."

If lawmakers reject the ruling, "we will end up with two entities, both with questions over their legality," he said.

The Tobruk parliament was Libya's second elected legislature since longtime dictator Moammar Gadhafi was overthrown and killed in a 2011 uprising against his rule. Since then, Libya has been gripped by unrest as authorities struggled to reign in regional, ideological and other militias vying for power.

Meanwhile, full-blown war is underway in the eastern city of Benghazi — the birthplace of the uprising — where pro-government forces are battling Islamist militias for control of the city.

Also, another warzone has opened up in western Libya, where the Misrata militias and allied fighters from a handful of western towns are fighting pro-government forces, including the rival Zintan militia in the mountain town of Kikla.

In the past three weeks, at least 400 people have been killed in both areas of fighting, thousands wounded and thousands were displaced.

Omar Homaidan, the spokesman for the Tripoli-based parliament, which is not internationally recognized, suggested that the supreme court's reasoning for the ruling was the fact that the March amendment that put in motion the June elections had passed without a needed majority vote in the assembly.

"We were aware that the session was being held without the quorum but the parliament was under tremendous pressure to pass the amendment," he said.

He said a possible way out of the crisis was to wait for a 60-member panel to finish writing Libya's new constitution, then call a referendum on it and hold elections after that.

Libya never had a constitution under Gadhafi's 42-year-rule and the turmoil that engulfed the nation since his ouster has stood in the way of the panel finishing its work.

Associated Press writer Maggie Michael contributed to this report from Cairo.