Militia loyal to the Tripoli authorities were advancing on eastern Libya on Wednesday where rebels demanding regional autonomy began exporting oil this week in defiance of the central government.
The offensive came as Islamists buoyed by parliament's ouster of liberal-backed prime minister Ali Zeidan on Tuesday moved to consolidate their new-found power.
The premier fled the country as the General National Congress approved the Islamist-sponsored no-confidence motion, stopping briefly in Malta before flying on to another European country, Maltese Prime Minister Joseph Muscat said.
The GNC named Defence Minister Abdullah al-Thani caretaker premier for the two weeks it now has to agree on a permanent successor.
But as Zeidan complained repeatedly while in office, real power over the armed forces lies not with the defence minister, but with GNC president Nuri Abu Sahmein, who on Monday ordered the assault on the rebel-held ports.
In the absence of a large enough regular army force to take on the heavily armed rebels, the advance guard of the task force is composed largely of militia loyal to the GNC.
Rebel fighters of the Cyrenaica Defence Force pulled back to the eastern region's historic border late Tuesday after militiamen of the Libya Shield Force pushed them out of the central coastal city of Sirte, a rebel commander told AFP.
The commander warned that the offensive by the fighters, mostly from Libya's third city Misrata, risked plunging the North African country back into civil war.
The advancing force was "a tribal militia, not a regular army unit", he said, asking not to be identified.
"Our forces have pulled back to Wadi Lahmar," some 90 kilometres (60 miles) east of Sirte, he added.
The town lies on the historic border between Tripolitania and the Cyrenaica region, whose pre-1963 autonomy the rebels want restored.
The chairman of Sirte city council, Abdelfattah al-Siwi, said there had been a "brief confrontation" between the rival fighters before the rebels withdrew.
The opposing forces were allies during the NATO-backed uprising of 2011 which ended the 42-year dictatorship of Muammar Gaddafi, who made his last stand in Sirte, his home town.
But the Cyrenaican fighters' move at the weekend to load oil onto a North Korean-flagged tanker in a deal not sanctioned by the state-run National Oil Corporation prompted the GNC chief to authorise military action against them.
The rebels had been blockading the main eastern oil export terminals since last July, but the loading of the Morning Glory marked a major escalation of the conflict and triggered Zeidan's ouster.
The threatened assault on export terminals that constitute a key part of Libya's oil infrastructure helped push up world prices on Tuesday.
The rebels' prolonged blockade of the ports already slashed Libyan exports from 1.5 million barrels per day to just 250,000.
But heavy clashes in the region, which was already a major battleground in the 2011 uprising, could deal longer-term damage to Libya's output.
The eastern rebels are among the Islamists' most potent rivals, but they also face competition for power from former rebels from the Zintan region, southwest of the capital, who backed Zeidan right up to his ouster.
Just hours after the GNC vote, the Islamist-controlled Tripoli military council ordered the "withdrawal of all forces occupying strategic positions, particularly inside Tripoli international airport and on the airport road".
That was a clear reference to the Zintan militia who have been deployed at the airport ever since the 2011 uprising, during which they played a major role in capturing Tripoli from Gaddafi's forces.
Zeidan had warned that his ouster was likely to trigger a power grab by the Islamists.
"I'm not hanging on for the sake of it but because I'm eager not to surrender the country to a certain party who threaten to lead it in a direction that does not serve the national interests," he said on Saturday.
Zeidan was denied even an honourable exit, with a prosecutor slapping a travel ban on him for suspected involvement in the embezzlement of public funds.
Former information minister Mahmud Shammam, who now runs a private television channel, charged that the prosecutor responsible was known for his "favouritism towards a certain political current".