A Libyan court suspended an energy exploration deal that the Tripoli government signed last year with Turkey, a judiciary source said, pausing an agreement that angered other Mediterranean powers and inflamed Libya’s own internal crisis.

The agreement had included scope for oil and gas exploitation in waters that Ankara and Tripoli have declared as their own, but which are also in part claimed by Egypt and Greece.

The deal had spurred rivalry in the eastern Mediterranean and played into a political standoff in Libya between the Government of National Unity (GNU) in Tripoli, in western Libya, and an eastern-based parliament that rejects its legitimacy.

Tripoli’s appeals court, which issued Monday’s decision, left room for the GNU to itself appeal the ruling, the source said, without giving further details on the basis for the decision.

Turkey sent military aid to Tripoli in 2019 to help the then internationally recognised government there ward off an assault on the capital by eastern forces in the civil war, which was backed by Egypt.

Later that year, Ankara and Tripoli struck a deal to establish a maritime boundary in eastern Mediterranean waters also disputed by Egypt and Turkey’s historic rival Greece, prompting both those countries to reject the agreement.

The GNU was installed in early 2021 through a U.N.-backed peace process and was initially supported by the eastern-based parliament.

It has maintained close ties with Turkey and in October struck the preliminary deal on energy exploration that the court suspended on Monday.

That deal had been rejected by the eastern-based parliament, which said the Tripoli government no longer had the mandate to strike any international agreements, as well as by both Egypt and Greece.

The GNU had no immediate comment on Monday’s court decision.

Libya, the third largest oil producer in North Africa, has been in chaos since a NATO-backed uprising ousted autocrat Muammar Gaddafi in 2011.