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 militias on Monday started to line up behind the rival camps.
General Khalifa Hifter, who lived for years in exile in the United States during the rule of autocrat Moammar Khadafy, presents 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. Authorities said 70 people were killed in the Benghazi fighting.
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 attempts at democracy.
Since Khadafy’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 of them are locally based, rooted in specific cities or neighborhoods. Others are based on ethnic allegiances. Some have embraced Al Qaeda-inspired extremism.
The country has held several elections, including ones that created a new Parliament. But administrations have been paralyzed by the 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 in Tripoli on Monday 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 of Misrata, one of the Islamists’ biggest constituencies. Footage posted online by Misrata forces showed hundreds of pickup trucks mounted with antiaircraft guns, tanks, and armored vehicles it said were ready to move into the capital.
But backing for Parliament seemed to be fading, including within the interim government installed by lawmakers after the prime minister’s removal.
The government, led by the defense minister, put forward a proposal for resolving the conflict. It said 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 Islamists’ opponents have held protests demanding it be dissolved.
Units of the weak military on Monday began splitting from their top generals to support Hifter.
The commander of an elite army unit in Benghazi, the Special Forces, announced his support for Hifter and his National Libyan Army, as he has called his loyalists. The 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.
Also, troops at a military air base in the eastern city of Tobruk joined Hifter’s forces, his spokesman Mohammed Hegazi said. The claim was quickly challenged by deputy Defense Minister Khaled el-Sherif.