BRUSSELS—European energy firms pledged Monday to finance half the cost of a natural-gas link from Russia to Germany, lending support to a pipeline plan that is fueling tensions within the European Union.

A consortium of five companies— Engie SA, OMV AG , Royal Dutch Shell PLC, Uniper SE and Wintershall Holding GmbH—said they would provide up to €4.75 billion ($5.1 billion) in long-term financing to Nord Stream 2 AG, a wholly owned subsidiary of Russia’s state-owned PAO Gazprom.

The move highlights Europe’s complicated relationship with Russia, and comes just days after U.S. President Donald Trump rejected Exxon Mobil Corp. ’s request for a waiver of sanctions so it could resume an oil venture with a Russian partner.

While European firms seek to protect access to Russia’s market and resources, most EU countries oppose the Kremlin’s intervention in Ukraine and fear its push to project more power across the world. That dichotomy has pitted EU nations against each other, with some calling Nord Stream 2 a Trojan horse put forth by Russia to exploit European disagreements while others, led by Germany, are championing the project as a key energy initiative.

About a dozen EU countries claim that allowing Gazprom to double the existing Nord Stream pipeline’s capacity would increase Europe’s reliance on Russian gas while enabling Moscow to cut back on eastern routes through Ukraine and Belarus. That would threaten the bloc’s energy security, while also undermining a key diplomatic objective for Brussels: supporting Kiev amid its conflict with Moscow.