Germany agreed Wednesday to warn Russia of potential sanctions and to support Ukraine's energy sector financially in a deal with the United States to settle a bitter rift between the allies over the Nord Stream 2 gas pipeline.

President Joe Biden's Republican rivals swiftly denounced the agreement and said it would embolden President Vladimir Putin, but the administration said it was too late to stop the pipeline and the deal instead secured a better outcome.

"This is a bad situation and a bad pipeline but we need to help protect Ukraine and I feel that we have made some significant steps in that direction," Victoria Nuland, the under secretary of state for political affairs, said as she unveiled details before a Senate haring.

A road sign directs traffic towards the Nord Stream 2 gas line landfall facility entrance in Lubmin, north eastern Germany, in 2020 A road sign directs traffic towards the Nord Stream 2 gas line landfall facility entrance in Lubmin, north eastern Germany, in 2020 Photo: AFP / Odd ANDERSEN

Biden, who welcomed Chancellor Angela Merkel last week, already waived the toughest sanctions required by Congress over Nord Stream 2 which will connect Russia and Germany through the Baltic Sea and is expected to be complete within weeks.

The pipeline has been vigorously opposed by many of Russia's neighbors -- especially Ukraine, which has been battling pro-Moscow separatists since 2014.

Ukraine sees the flow of Russian gas through its territory en route to Europe both as leverage and an indispensable financial boon, with transit fees bringing some $3 billion a year.

German Chancellor Angela Merkel and Ukrainian President Volodymyr Zelensky meet in Berlin on July 12, 2021 amid disagreements on the Nord Stream 2 pipeline German Chancellor Angela Merkel and Ukrainian President Volodymyr Zelensky meet in Berlin on July 12, 2021 amid disagreements on the Nord Stream 2 pipeline Photo: POOL / STEFANIE LOOS

In a joint statement with the United States, Germany said that it had committed to respond to Russia if Ukraine's fears materialize.

"Should Russia attempt to use energy as a weapon or commit further aggressive acts against Ukraine, Germany will take action at the national level and press for effective measures at the European level, including sanctions, to limit Russian export capabilities to Europe in the energy sector," it said.

Germany also said it would use all leverage to persuade Russia to extend by up to 10 years a gas transit agreement through Ukraine that is set to expire at the end of 2024, including by appointing a special envoy by September 1 to support negotiations.

The Kremlin said that Merkel raised an extension in transit rights in a call Wednesday with Putin and also that the two leaders were "satisfied" that Nord Stream 2 was near completion.

A pipe is seen in 2019 at the construction site of the Nord Stream 2 gas pipeline in Lubmin, northeastern Germany A pipe is seen in 2019 at the construction site of the Nord Stream 2 gas pipeline in Lubmin, northeastern Germany Photo: AFP / Tobias SCHWARZ

Ukraine and Poland made clear they still opposed the pipeline, saying together that it threatens Central Europe.

US Secretary of State Antony Blinken and German Foreign Minister Heiko Maas have a beer together in Berlin in June 2021 as relations between the allies dramatically improve under President Joe Biden US Secretary of State Antony Blinken and German Foreign Minister Heiko Maas have a beer together in Berlin in June 2021 as relations between the allies dramatically improve under President Joe Biden Photo: POOL / Andrew HARNIK

Germany also agreed to help Ukraine reduce reliance on Russian energy including by setting up a fund of at least $1 billion.

Addressing another key priority of Merkel and Biden, the fund will support renewable energy and reductions in carbon emissions blamed for climate change.

In a show of support for Kiev, the White House announced that Biden will receive Ukrainian President Volodymyr Zelensky at the White House on August 30.

Germany, which had intense friction with former president Donald Trump, has hailed the approach of Biden as a revitalization of the alliance.

"I am relieved that we have found a constructive solution regarding Nord Stream 2," German Foreign Minister Heiko Maas said.

US officials said they expected Germany to adhere to its promises even after Merkel leaves office later this year.

Republicans swiftly criticized the agreement, saying it betrayed Ukraine and would strengthen the hand of Putin, under whom Russia seized Crimea from Ukraine.

Republican Senator Ted Cruz has pointed to concerns about Nord Stream as he holds up confirmations of key Biden appointees to diplomatic posts.

"We always knew Biden was in bed with Putin; now they're spooning," Cruz said.

Biden has also faced criticism from Democrats on Nord Stream 2 but his defenders call the Republican attacks farcical, noting that Trump unabashedly praised Putin and showed distaste for Ukraine, with his strong-arming of Zelensky triggering his first impeachment.

Nuland, a former career diplomat famous for rallying behind pro-Western protesters in Ukraine in 2013, bluntly replied to Cruz at the Senate hearing that the Trump administration, which took over in 2017, bore responsibility.

"I believe that we were in 2016 on our way to stopping the pipeline," she said. "When the Biden administration came into office four years later, that pipeline was 90 percent-plus complete."