The United States and Australia went to extraordinary lengths to keep Paris in the dark as they secretly negotiated a plan to build nuclear submarines, scuttling France’s largest defense contract and so enraging President Emmanuel Macron that on Friday he ordered the withdrawal of France’s ambassadors to both nations.

Macron’s decision was a stunning and unexpected escalation of the breach between Washington and Paris, on a day that the two countries had planned to celebrate an alliance that goes back to the defeat of Britain in the American Revolutionary War.

Yet it was driven by France’s realization that two of its closest allies have been negotiating secretly for months. According to interviews with U.S. and British officials, the Australians approached the new U.S. administration soon after President Joe Biden’s inauguration and said they had concluded that they had to get out of a $60 billion agreement with France to supply them with a dozen attack submarines.