CAIRO (AP) — Libya resumed oil exports Wednesday, ending a hiatus that lasted months.

The resumption came after the country restarted production at oil fields following the firing of the chairman of the state-run oil corporation by one of the country’s rival governments.

A Malta-flagged tanker, Matala, docked at the al-Sidra terminal to ship one million barrels of crude oil, the new leadership of the National Oil Corporation said. The vessel will then head to Italy, it said.

Two other tankers, the Marshall Islands-flagged Nissos Sifnos and the Liberia-flagged Crudemed, were scheduled to ship 1.6 million barrels Wednesday from the terminals of Zueitina Ras Lanuf, according to the NOC.

Last week, the NOC lifted a force majeure which was declared in April at several oil facilities after tribal leaders, aligned with powerful commander Khalifa Hifter, shut them down. The force of majeure is a legal maneuver that enables a company to get out of its contract obligations because of extraordinary circumstances.

Production was resumed Tuesday at several fields including the Sharara, the county’s largest, after three months of closure, the NOC announced.

Abdul Hamid Dbeibah, prime minister of the the Tripoli-based government, announced last week the sacking of Mustafa Sanalla, the chairman of the NOC. He appointed Farhat Bengdara, a former governor of Libya’s central bank, to head the crucial oil company.

The move was rejected by Sanalla, who said Dbeibah’s government lacked legitimacy.

NOC’s new chairman, Bengdara, became known for his strong ties with the United Arab Emirates and Hifter, whose forces control the country’s eastern and much of southern areas.

His appointment was seen as a move by Dbeibah to gain control over oil revenues and gain the support of Hifter in his rivalry with Bashagha.

Libya is now ruled by two rival administrations, Dbeibah’s government in Tripoli and the government of Fathi Bashagha, who was appointed as prime minister by the east-based parliament in February and is now based in the city of Sirte.

The North African country has been wrecked by conflict since the 2011 NATO-backed uprising turned civil war toppled and later killed longtime dictator Moammar Gadhafi.

The country’s prized light crude has long been a feature of Libya’s conflict, with rival militias and foreign powers jostling for control of Africa’s largest oil reserves.

Tribal leaders, aligned with Hifter, in April shut down oil facilities, including the country’s largest oil field and major terminals, likely to deprive Dbeibah’s from funds.

The closures caused Libya’s daily output of oil to drop by two-thirds. The country’s production was at 1.2 billion barrels a day earlier this year.

The shutdown had come amid skyrocketing oil prices following the Russian war in Ukraine It also exacerbated the country’s electricity shortages and sparked protests, including one that resulted in the storming of the east-based parliament in Tobruk.