BRUSSELS—The European Union’s biggest countries want to carve a middle path between China and the U.S. Last week’s surprise announcement of a new defense pact among the U.S., the U.K. and Australia, alongside the cancellation of a multibillion-dollar French submarine deal with Canberra, shows how hard that will be.

EU countries generally consider the U.S. their closest ally but don’t share all its concerns and priorities regarding China. The bloc has deep economic ties to China, both as an export market and supplier. European...

BRUSSELS—The European Union’s biggest countries want to carve a middle path between China and the U.S. Last week’s surprise announcement of a new defense pact among the U.S., the U.K. and Australia, alongside the cancellation of a multibillion-dollar French submarine deal with Canberra, shows how hard that will be.

EU countries generally consider the U.S. their closest ally but don’t share all its concerns and priorities regarding China. The bloc has deep economic ties to China, both as an export market and supplier. European powers, led by Germany and France, have sought to balance their concerns about Beijing’s growing assertiveness with political engagement.

SHARE YOUR THOUGHTS

How do you think European countries might carve a middle path between the U.S. and China? Join the conversation below.

But in a replay of tensions that roiled the trans-Atlantic alliance under President Donald Trump, European governments are finding themselves forced to choose between their decades-old U.S. alliance and a China that has become the EU’s biggest trading partner in goods.

“Our strategy is not a strategy of confrontation. It is a strategy of cooperation,” EU foreign policy chief Josep Borrell said last week when the bloc articulated a new approach to the Indo-Pacific region, including China.

Some in Europe are critical of calls to confront or contain Chinese power. Others, more worried about Russia—such as Poland or the Baltic states—generally share Washington’s assessment of Beijing, but worry the increased focus on Asia has distracted from Russia’s fraught conflict with Ukraine, political unrest in Moscow’s close ally Belarus, and other tensions along Europe’s eastern border.

Janka Oertel, Director of the Asia Program at the European Council on Foreign Relations in Berlin, said EU troubles stem in part from a lack of clarity about its own objectives regarding China, making it reactive to U.S. initiatives.

“If China is not really interested in cooperation, or only interested in cooperating on Chinese terms, then how do we think we can be different in policy and not just in tone from the U.S.?” she said. “That is something we have not properly answered.”

French President Emmanuel Macron has expressed concerns about permitting NATO to focus more clearly on China.

Photo: costas baltas/Reuters

The Biden administration spent its early months talking with Europeans about cooperating against the challenges posed by China’s rise. But last week’s defense pact, known as AUKUS, shows that Washington will grab opportunities to contain China’s military prowess even if it means ignoring European interests, European diplomats say.

Beijing, meanwhile, has paid little heed to Europe’s criticisms of its human rights record and its regional muscle-flexing. Beijing has made increasingly clear that Europe’s economic interests in China come with political strings attached.

The impact of last week’s AUKUS announcement is still playing out in Europe, but some diplomats say it is eroding trust in Washington. Concerns are widespread about how the pact unexpectedly sank France’s €56 billion, equivalent to around $65.5 billion, submarine deal with Australia with no consultation. There are also worries that the growing U.S. pivot to Asia could weaken Washington’s focus on European security.

However, France’s infuriated reaction to the announcement—it recalled its ambassadors to Washington and Canberra—is also causing anxiety in some European capitals. With President Emmanuel Macron facing presidential elections next spring and France assuming the rotating EU presidency in January, some Europeans are pushing to ensure the argument doesn’t cause an entrenched rift in trans-Atlantic ties.

“I think it is important to say, given the talks going on in Europe right now, that I see Biden as very loyal to the trans-Atlantic alliance,” Danish Prime Minister Mette Frederiksen told Danish media in New York on Wednesday.

Mr. Biden moved to soothe the rift Wednesday in a call with Mr. Macron, The U.S. president acknowledged in a joint statement that allies, like France, should have been consulted on the defense pact. The two leaders will meet in late October to discuss security cooperation, and the statement underlined the importance of the French and EU roles in the Indo-Pacific.

Since Mr. Biden took office in January, Europe has tilted toward U.S. concerns about China even while trying to strike an independent line. Europe has made one of its priorities an increased EU naval presence in the Indo-Pacific to protect freedom of navigation, building on an already significant French naval effort to challenge Beijing’s grip over regional sea lanes.

The U.S. and EU have expanded formal talks about China that began in the last days of the Trump administration. Washington and Brussels both advocate reforming world trade rules to better protect Western economies from what they call unfair Chinese competition. A new U.S.-EU council on trade and technology was planned to launch next week in Pittsburgh.

German Chancellor Angela Merkel on Wednesday attended an honorary roll-call of soldiers of Germany's armed forces, who served in the operation to evacuate people from Afghanistan.

Photo: David Hecker/Getty Images

Some of that work is now threatened. France has pushed to delay the Pittsburgh meeting and diplomats say the willingness of the EU’s three main actors in the Indo-Pacific region—France, the Netherlands and Germany—to work closely with Washington may be tested following their exclusion from the AUKUS deal.

European officials say France could now intensify its push to expand the EU’s ability to act independently of the U.S. and other powers on defense and security. Dubbed strategic autonomy, the long-discussed concept has resurfaced following the messy U.S. exit from Afghanistan, though EU members show little sign of readiness to increase military spending to take on major new military burdens.

Mr. Macron has also already expressed concerns about permitting NATO to focus more clearly on threats from China.

With Britain out of the EU and German Chancellor Angela Merkel planning to retire following Sunday’s German elections, some observers in London and around Europe worry that Mr. Macron’s positions could further strain trans-Atlantic ties and NATO.

“A partnership works when both parties are honest and truthful with each other,” said EU internal markets commissioner Thierry Breton, who is French, in a speech Tuesday in Washington. “But trust is not a given. And after the latest events, there is a strong perception that trust between the EU and the U.S. has eroded.”

Meanwhile, EU efforts to insulate its economic interests from political tensions with China face difficulties.

The European Parliament in May voted to halt approval of an investment agreement the EU and China struck in December. The deal aims to broaden European access to China’s market and tackle some of what Europe considers to be unfair trade practices. The EU parliament’s vote came after China slapped sanctions on EU lawmakers, diplomats and academics in response to the EU blacklisting four Chinese officials over the alleged oppression of Muslims in Xinjiang.

China has pulled its diplomats from Lithuania and demanded the EU and NATO member withdraw its ambassador from Beijing after Vilnius upgraded the diplomatic status of Taiwan’s mission in the country. Tensions have also been growing between the Czech Republic and China over the European country’s budding ties with Taiwan. Last month, former Chinese foreign ministry officials publicly assailed the EU’s French ambassador to Beijing, Nicolas Chapuis, after he was critical of China’s diplomacy toward Europe.

Write to Laurence Norman at laurence.norman@wsj.com and Drew Hinshaw at drew.hinshaw@wsj.com