By RAMI MUSA, Associated Press

BENGHAZI, Libya (AP) — Libya's U.N.-brokered presidency council has announced the reopening of the country's vital oil terminals after 18 months of closure despite threats by a rival military commander that his forces could target tankers entering Libya's territorial waters.

The announcement came after the U.N. envoy to Libya, Martin Kobler, struck a deal more than a week ago with the terminals' militia commander, Ibrahim Jedran, who was behind the December 2014 closure that caused a sharp decline in state revenue.

Libya's crude, known as light, sweet crude, is rare and especially valuable because it's easier for refineries to convert into diesel and gasoline. Revenues have been dealt a major blow and Libyans lost over $100 billion in potential profits over the past three years, according to oil officials. Libya exported a total of 146 million barrels of oil in 2015, compared to 531 million barrels in 2012.

Details of the deal with Jedran, who commands the force known as Petroleum Facilities Guards, were not disclosed but critics speculated that it involved billions of dollars, sparking accusations that Kobler and the U.N. are empowering the warlord viewed by many as having held Libya's oil hostage for the past two years.

Moussa al-Kouni, deputy head of Libya's U.N.-brokered presidency council, announced the terminals reopening late on Thursday at the Ras Lanuf terminal, expressing "hope and optimism" that the step marks the "beginning for our country's recovery." As he spoke, Jedran stood next to him.

Since the ouster of Libya' longtime leader Moammar Gadhafi in 2011, the oil-rich North African country has sunk into turmoil.

The three major oil terminals, Ras Lanuf, al-Sidra and al-Zueitina, operated intermittently under Jedran's control until his troops completely shut them down after an assault on Ras Lanuf by a rival, Tripoli-based militia.

But the anticipated announcement of the terminals' reopening did not pass without threats.

Libya's chief of staff Brig. Gen. Abdel-Razek al-Nadhouri, who answers to the internationally-recognized parliament based in eastern Libya, threatened on Tuesday to target foreign oil tankers if they entered Libyan territorial waters without parliament's approval.

Libya remains split between the U.N.-brokered presidency council and unity government that are based in the capital, Tripoli, and the parliament in the east. According to the U.N. deal signed last year, the parliament is supposed to vote to approve the government — something it has still failed to do.