A Russian pipeline carrying natural gas to Germany is emerging as a potential point of leverage for the U.S. to deter Russia from invading Ukraine. It is also a sore spot between Berlin and Washington.

The Nord Stream 2 pipeline, which is completed but not yet certified for operation, is a key component of German energy plans, a potential source of Russian revenue and, U.S. officials said, a topic of discussions between Washington and Berlin over how to stop Russia’s military pressure on Ukraine.

The Biden administration wants to secure assurances that Germany won’t let the pipeline become operational if Moscow invades Ukraine, said a U.S. congressional aide briefed on the discussions.

Germany has been less clear. After a meeting of European Union leaders last week that warned Russia of massive but unspecified consequences, German Chancellor Olaf Scholz said the pipeline is a private project whose certification would be decided in a nonpolitical way. Certification is unlikely before the second half of next year, a German regulator said, citing administrative reasons.

President Biden has said economic penalties will be at the forefront of retaliation should Russia escalate hostilities. Administration officials want that retaliation to be done jointly with European allies, making German cooperation necessary to targeting Nord Stream 2.

“The United States sees the Nord Stream 2 pipeline as a Russian geopolitical project that undermines the energy security and the national security of a significant part of the Euro-Atlantic community,” Assistant Secretary of State Karen Donfried told reporters Tuesday. She declined to detail discussions with Berlin beyond saying the two allies are working closely together.

White House officials declined to comment. The German Foreign Ministry didn’t respond to requests for comment.

The 765-mile-long Nord Stream pipeline is a marquee project for the Kremlin that will allow Russia to abandon a transit network that passes through Ukraine, giving it greater sway over energy supply to Germany and Central and Western Europe. That, Secretary of State Antony Blinken and other U.S. officials have said, makes the pipeline a source of leverage.

Members of Congress are pressuring Mr. Biden to target Nord Stream. Under a deal struck last week, legislation expected to go before the U.S. Senate next month would require the Biden administration to apply sanctions to Nord Stream 2 AG, the Switzerland-based Russian company that built the pipeline, within 15 days of passage.

If the administration wants to waive the sanctions, as it did earlier this year, the proposed law requires congressional approval to do so.

Mr. Scholz’s government, just weeks in office, has signaled it will follow the agreement his predecessor Angela Merkel reached with Mr. Biden in July. Under that agreement, Germany committed to take action “to limit Russian export capabilities to Europe in the energy sector” or other sectors, if Russia commits aggressive acts toward Ukraine.

Mr. Scholz’s governing coalition includes the Greens, which hold the foreign and the economics ministries and have long opposed Nord Stream 2. “In the event of further escalation, this gas pipeline could not come into service,” Foreign Minister Annalena Baerbock told German television station ZDF earlier this month in Berlin’s strongest statement to date about the project.