No pain, no gain. That’s as true in diplomacy as in the gym. The United States has gained much with its agreement to share nuclear-powered submarine technology with Australia as part of a new Australia-United Kingdom-United States (AUKUS) accord. But this achievement comes at a cost: France, complaining of a “knife in the back,” recalled its ambassadors from Canberra and Washington (but not London) in its fury over losing a $66 billion agreement to sell diesel submarines to Australia.

Was it worth it? Yes. Could it have been better handled? Also yes. This is a bit like a football team scoring a touchdown and then getting penalized 15 yards for unsportsmanlike conduct.

AUKUS is the kind of “tremendously big deal” that former president Donald Trump always bragged about but seldom delivered. It turns the “Pacific pivot” that former president Barack Obama advertised into more than an empty slogan.

Ten years ago, Obama dispatched 2,500 U.S. Marines to Australia. The impact of that deployment is trivial compared with having eight Australian nuclear submarines patrolling the silent depths of the Pacific. China is building cruise missiles and ballistic missiles to target surface ships, including U.S. aircraft carriers. But the Pentagon reports that “it continues to lack a robust deep-water anti-submarine warfare capability.”

That is a weakness the Royal Australian Navy will be able to exploit in conjunction with the U.S. and British fleets. (The United States already operates 68 nuclear submarines, Britain 11.) Once Australia’s nuclear submarines are ready, China’s ability to dominate sea lanes and invade or blockade Taiwan will be reduced. (The naval balance of power would tilt even further against China if Japan, which already has 20 diesel submarines, were to build its own nuclear subs.) But the first submarine is not due to be built Down Under until 2040. The program needs to be accelerated to reduce Australia’s window of vulnerability — and reduce the incentives for China to commit aggression while it still can.

Chinese President Xi Jinping has no one but himself to blame for this development. China’s expansive territorial claims, appalling human rights abuses and brutish “wolf warrior” diplomacy have alarmed its neighbors — and created a strategic opening for the United States. Beijing, for example, tried to punish Australia with trade sanctions for refusing to buy Huawei’s 5G technology, criticizing Chinese human rights record and calling for a probe of covid-19’s origins. As a result, Australian perceptions of China turned sharply negative.

That allows Biden to assemble a coalition to contain China. This week, just days after the announcement of AUKUS, the leaders of the Quad — a coalition of the United States, Japan, Australia and India — will meet in Washington. AUKUS and the Quad are the most important strategic initiatives undertaken by the United States in the 21st century, and they will help dispel some of the concerns about U.S. retreat following the withdrawal from Afghanistan. The United States could be even more effective in countering China if Biden would rethink his born-again protectionism and rejoin the Trans-Pacific Partnership that he extolled as vice president.

The only country as unhappy about AUKUS as China is France. To a certain extent, French pique is understandable. Paris was unnecessarily kept in the dark while this new pact was being negotiated. (That’s a big intelligence failure for France’s overseas intelligence service, the DGSE.) It was diplomatic malpractice for the Biden administration not to notify French President Emmanuel Macron in advance. It’s no excuse to say that it was Australia’s responsibility if Biden has to deal with the fallout. France would have been upset in any case, but it might have been mollified with other concessions or inclusion in the new partnership. (Although adding an F in front of AUKUS would not produce a salutary sound.)

This is of a piece with the Biden administration’s failure to consult with European allies in advance of the U.S. pullout from Afghanistan. You expect this kind of ham-handedness from an “America First” administration. You expect better from the “America Is Back” team.

But France’s enraged response is over the top. Macron should remember that he supported a now-suspended European Union investment agreement with China that was signed in December 2020 — i.e., right before Biden took office — over U.S. objections. Back in February, Macron rejected the idea of a U.S.-E.U. common front against China. Now he complains when the United States pursues its own strategy against China. What’s French for chutzpah?

Even before AUKUS was unveiled, the French diesel-sub program was experiencing delays and cost overruns. Macron should not be shocked that Australia would exercise an opt-out clause to acquire a vastly superior weapons system. France, of all nations, should understand the concept of raison d'état.

The United States has had ruptures with France before — in 1956 over the Suez crisis, in 1966 over France’s withdrawal from the NATO military command, in 2003 over France’s opposition to the invasion of Iraq — and America’s oldest alliance has always emerged intact. It will survive this time, too. Biden should have handled France better, but he deserves credit for a major win in the U.S. competition with China — the most significant strategic struggle of the 21st century.