BENGHAZI, Libya (Reuters) - Forces loyal to a rival Libyan government controlling the capital Tripoli have withdrawn from frontline bases near the country's biggest oil ports, a spokesman said on Friday, raising hopes the ports might soon be reopened.
A Tripoli official said the internationally recognized government and the rival administration, which have fought since December over the two biggest oil ports in eastern Libya, had reached an agreement to withdraw. He did not say whether troops had been moved yet.
The move, if confirmed, might pave the way to restart the Es Sider and Ras Lanuf ports which shut down in December due to fighting.
Libya is divided with factions allied to two governments -- the internationally recognized one in the east and the rival administration in Tripoli - vying for control of territory and oil facilities.
A force loyal to Tripoli had moved east in December trying to take the Es Sider and Ras Lanuf ports, clashing with troops of the official government defending the terminals.
Ali al-Hassi, a spokesman for an oil port protection force loyal to the official government, said the rival force had left positions west of Es Sider.
"They moved to Misrata (a western city)," he said.
A Tripoli government official said both sides had agreed to move back forces and hand over the ports to state oil firm NOC.
Troops reporting to Tripoli would move west to Sirte where Islamic State militants have set up a presence. The rival side would move to Ajdabiya to the east, he said.
Hassi denied his troops would leave, adding that the rival force had already left.
"We have not pulled out from Ben Jawad. We are there," he said, referring to a town near the Es Sider port both sides have fought over.
Pictures on social media purportedly showed Hassi's troops in Ben Jawad, a town which had been a command center of the rival force devoid of residents when Reuters reporters visited it in February and March.
Both governments rely on former rebels who teamed up in 2011 to topple Muammar Gaddafi and now fight each other. They call themselves armies but are in fact a loose alliance of factions united mainly by common enemies.
The conflict is part of a complex struggle involving tribes, regions and Islamist and more secular factions backed by different regional powers.
Reporting by Ayman al-Warfalli and Ulf Laessing; editing by Ralph Boulton and David Gregorio