Tripoli-based National Oil Corp (NOC) said on Wednesday four export terminals were being reopened after eastern factions handed over the ports, ending a standoff that had shut down most of Libya's oil output.
Production and export operations would be restored "within the next few hours", an NOC statement said, although the restart at Es Sider and Ras Lanuf, where workers were evacuated and storage tanks damaged in fighting last month, was expected to be gradual.
A tanker at Hariga was due to start loading 1 million barrels of crude on Wednesday afternoon, a port source said.
Eastern factions had effectively blockaded exports from the territory they control since late June, saying too much oil revenue processed through Tripoli was going to armed groups based in western Libya, including their rivals.
The disruption had threatened to keep offline as much as 850,000 barrels per day (bpd) of Libyan oil, from previous production of a little over 1 million bpd.
It risked deepening a wedge between rival political and military alliances based in eastern and western Libya since disputed elections four years ago, and raised the prospect of complicating U.N.-led efforts to end years of turmoil since the country's 2011 uprising.
Ras Lanuf and Es Sider terminals were shut when armed opponents of eastern-based commander Khalifa Haftar attacked them on June 14.
The assault was repelled a week later, but eastern officials aligned with Haftar blocked the internationally recognised NOC in Tripoli from re-entering the ports and stopped loadings at Zueitina and Hariga terminals, saying they would take control of exports through a parallel NOC based in the east.
NOC Tripoli said the ports were restored to its control on Wednesday, allowing it to lift force majeure, a legal waiver on contractual obligations, at all four terminals. It commended Haftar's Libyan National Army for "putting the national interest first" by handing them back.
Eastern oil facilities guards and the head of the parallel NOC, Faraj Said, confirmed the ports were reopening, although Said told Reuters that Ras Lanuf and Es Sider, which have been damaged in repeated rounds of fighting, required repairs.
"The ports of Zueitina and Hariga are now open for any tankers carrying a contract. Ras Lanuf and Es Sider need some maintenance," he said.
A Reuters team that visited the ports on Tuesday found the area littered with armed vehicles destroyed in last month's clashes.
Over the past two weeks eastern factions had come under intense international pressure to end the stoppage, diplomatic sources said.
Sources in the east said conditions for reopening the ports included ensuring an equitable distribution of resources across Libya, and welcomed the suggestion by the U.N.-backed government in Tripoli of a committee to review central bank spending.
NOC Tripoli Chairman Mustafa Sanalla said the debate over fair distribution of oil revenues was "at the heart of the recent crisis".
"The real solution is transparency, so I renew my call on the responsible authorities, the ministry of finance and central bank, to publish budgets and detailed public expenditure," he said in the NOC statement.
But analysts say any deal is likely to be fragile given the slow progress so far in unifying rival central banks in east and west Libya, reforming spending and reducing the economic power of armed groups.
Libya's oil production has fluctuated widely since 2013, sending what was one of the wealthiest economies in the region into crisis.
The gap between the official and black market exchange rates has fuelled corruption and criminal activity, and bloated state salaries, while subsidies remain unreformed.
A Western diplomat described the reopening of the ports as a "step in the right direction," but said the actions "durability depends on how quickly a fiscal reform package moves forward".
(Editing by Dale Hudson and Edmund Blair)