MOSCOW (AP) — Russian and Ukrainian gas companies say they have finalized a slew of contracts ensuring uninterrupted transit of Russian natural gas to Europe.

Ukraine’s President Volodymyr Zelenskiy hailed the agreements that were signed late Monday, saying they will allow Ukraine to get at least $7 billion in transit payments from Russia over the next five years.

Zelenskiy said on Facebook the documents ensured Ukraine’s “energy security and well-being” and let “Europe know that we won’t fail it when it comes to energy security.”

The deal that comes just 24 hours before the current transit contract expires on Tuesday will ease European fears of an interruption in Russian gas supplies. Russia ships about 40 percent of its European gas deliveries through pipelines that cross Ukraine.

ADVERTISEMENT

Russia’s Gazprom state-controlled gas giant and Ukraine’s Naftogaz energy company described the agreements signed in Vienna late Monday as a hard-won compromise that followed five days of strenuous talks.

The agreements formalized a tentative deal reached earlier this month that envisaged shipments of 65 billion cubic meters of natural gas through Ukraine in 2020 and annual shipments of 40 billion cubic meters thereafter.

Those amounts are smaller than what Russia has sent through Ukraine in previous years. Russia has been working intensively to build new delivery networks that bypass Ukraine.

They include the prospective Nord Stream 2 undersea pipeline between Russia and Germany. Russian officials vowed that it would be completed next year despite the U.S. sanctions that forced a Swiss company laying sections of the pipeline to suspend work. They said that Gazprom has its own assets to complete the construction.

The Russia-Ukraine gas agreements come as the two neighbors remain locked in a tug-of-war that followed Russia’s annexation of Ukraine’s Crimea and Moscow’s support for a separatist insurgency in eastern Ukraine.

It follows the Dec. 9 talks in Paris between the leaders of Ukraine, Russia, France and Germany on settling the conflict in the east. The negotiations marked Zelenskiy’s first encounter with Russian President Vladimir Putin, during which they talked about the gas issue, paving way for the deal.

The Ukraine-Russia gas deal envisaged payment by Russia of $2.9 billion to settle an arbitration claim resulting from previous transit disputes and waived any other claims related to the 2009 transit contract.

Naftogaz CEO Andriy Kobolyev hailed the agreements as a compromise ensuring that Ukraine’s gas transport network will operate without loss over the next five years and “demonstrated Ukraine’s reliability as a transit partner for the EU.”

Gazprom CEO Alexei Miller described the set of agreements as a “big package deal that restored the balance of interests between the parties.”

“Gazprom has shown again that it’s a responsible supplier and a reliable partner,” Miller said.