TRIPOLI, Libya -- A revolt by a renegade general against Islamists who dominate Libya's politics threatened to spiral into an outright battle for power that could fragment the North African nation, as the country's numerous armed militias started to line up Monday behind the rival camps.
Gen. Khalifa Hifter, who lived for years in exile in the United States during the rule of autocrat Moammar Gadhafi, touts himself as a nationalist who is waging a war against terrorism to save Libya from Islamic extremists. His loyalists and allies in the past days attacked Islamist militias in the eastern city of Benghazi and on Sunday stormed the Islamist-led parliament in Tripoli.
Gen. Hifter's opponents accuse him of seeking to grab power, acting on behalf of former regime figures in exile by orchestrating an Egyptian-style military overthrow of Islamists that would wreck already struggling attempts at democracy.
Since Gadhafi's ouster and death in a 2011 civil war, Libya has been in chaos. The central government has almost no authority. The military and police, shattered during the civil war, have never recovered and remain in disarray. Filling the void are hundreds of militias around the country. Many are locally based, rooted in specific cities or neighborhoods. Others are based on ethnic allegiances, while others still have embraced al-Qaida-inspired extremism.
The country has held several elections, including ones that created a new parliament. But administrations have been paralyzed by competition between Islamist parties and their rivals, each of which are backed by militias. Islamist lawmakers who dominate parliament removed the Western-backed prime minister earlier this year and named an Islamist-leaning figure, Ahmed Maiteg, to replace him in a vote their opponents say was illegal.
In response to the parliament attack, the Islamist-leaning head of the legislature, Nouri Abu Sahmein, ordered militias backing his camp to deploy Monday in Tripoli to resist what he called "the attempt to wreck the path of democracy and take power." The pro-parliament militias are largely from Libya's third-largest city, Misrata, one of Islamists' biggest constituencies. Footage posted online by Misrata forces showed hundreds of pickup trucks mounted with anti-aircraft guns, tanks and armored vehicles that it said were ready to move into the capital.
But backing for parliament appeared to be eroding, including within the interim government installed by lawmakers after the prime minister's removal.
The interim government, led by the defense minister, offered a proposal to resolve the conflict, suggesting the parliament should hold a new vote on a prime minister, pass a budget and then halt work to allow new parliament elections. Parliament's mandate expired earlier this year, and the Islamists' foes have held protests demanding that it be dissolved.
Units of the weak military began splitting from their top generals Monday to support Gen. Hifter. The commander of an elite army unit in Benghazi, the Special Forces, announced his support for Gen. Hifter and his National Libyan Army, as he has called his loyalists. The Special Forces unit is the only real state force in Benghazi, Libya's second-largest city, where it has been fighting militants for months.
"Anyone who hurts the nation will be smashed. We are with the will of the people alongside the National Libyan Army in the battle of dignity," the commander, Wanis Abu Khamada, said in a televised address.
Troops at a military air base in the eastern city of Tobruk also joined Gen. Hifter's forces, said his spokesman, Mohammed Hegazi -- the latest of about five air bases to back the general in recent weeks. The claim was quickly challenged by Deputy Defense Minister Khaled el-Sherif, who said the base is still under "legitimate authorities."
"We are the real army of Libya," Mr. Hegazi told Libya al-Ahrar TV. "We are waiting for orders ... to either seek victory or be killed."
In a sign that the violence could worsen, a number of foreign embassies in Tripoli shut down, including those of Saudi Arabia, the United Arab Emirates and Algeria, which also closed its borders with Libya, according to several news reports.
Gen. Hifter was a senior general in Gadhafi's military but defected, moving to the United States and living for years in exile in Virginia in the 1980s. He returned during the 2011 uprising against Gadhafi.
The general is aiming to harness widespread public frustration with the weak military, the government's impotence and Islamists' power. He appears to have the support of one of the country's most powerful militias, from the western Zintan region. Gen. Hifter also draws strong backing in the eastern part of the country, especially Benghazi, where many demand autonomy from the central government, and where anger at Islamists is high. Suspected extremist militias have been killing military and police officials, judges, activists and clerics in the city almost daily for months.
In Benghazi, a lawyer prominent in the city said there is general public backing there for Gen. Hifter because he is seen as a figure who "can rescue them from terrorism." But the lawyer said he personally worries that after defeating Islamists, Gen. Hifter would become a new Gadhafi.
On Friday, Hifter loyalists attacked Islamic extremist militias in Benghazi in fighting that authorities said left 70 dead.
On Sunday, pro-Hifter militiamen stormed parliament, ransacking the legislature, then withdrew toward Tripoli's airport on the city's southern edges, clashing with rivals. By Monday morning, fighting stopped.