Libya petrol shortages
A line of cars wait their turn at a petrol station due to shortages in Tripoli Reuters

Libya's acting Prime Minister Abdullah al-Thinni said the newly-elected government had reached a deal to take back two major oil ports that had been in the control of rebel groups for nearly a year, bringing an end to the country's oil crisis.

The oil terminals at Ras Lanuf and Es Sider had been out of use since separatist rebels seized control almost a year ago, demanding greater autonomy for the eastern region of the country.

"We have successfully reached an agreement to solve the oil crisis. We have received today Ras Lanuf and Es Sider oil ports -- thankfully without the use of force," Thinni said from Ras Lanuf late Wednesday.

"I officially declare this is the end of the oil crisis."

Thinni said he had reached a deal with Ibrahim Jathran, the rebel leader, who told reporters at a news conference that he had handed over control of the ports as a "goodwill gesture" to the newly-elected parliament.

The return of the sizeable terminals could free up around 500,000 barrels a day of crude oil for export and boost the state's coffers significantly.

An official from the Libyan central bank said last month that the prolonged oil standoff had cost the country $30bn (£18bn, €22bn) in lost oil revenues.

Disputes over oil production have been at the centre of a number of political disputes in Libya since the former leader Muammar Gaddafi was ousted in a NATO-backed campaign in 2011.

Prior to Gaddafi's overthrow, Libya produced around 1.4m barrels of oil per day but instability has brought that number to 150,000 barrels per day at times. Crude output stood at 321,000 barrels on Tuesday.

Reports of the oil terminals' imminent handover brought the price of Brent crude futures below $112 a barrel on Wednesday.