PARIS — Calling American and Australian behavior “unacceptable between allies and partners,” France announced on Friday that it was recalling its ambassadors to both countries in protest over President Biden’s decision to provide nuclear-powered submarines to Australia.

It was the first time in the history of the long alliance between France and the United States, dating back to 1778, that a French ambassador has been recalled to Paris in this way for consultations. The decision by President Emmanuel Macron reflects the extent of French outrage at what it has a called a “brutal” American decision and a “stab in the back” from Australia.

In a statement, Jean-Yves Le Drian, the French foreign minister, said the decision was made by Mr. Macron, who is understood to be furious about the way the United States, Britain and Australia negotiated the deal without informing France.

Australia on Wednesday canceled a $66 billion agreement to purchase French-built, conventionally powered submarines, hours before the deal with Washington and London was announced.

“At the request of the President of the Republic, I have decided to immediately recall our two ambassadors to the United States and Australia to Paris for consultations,” the statement said. “This exceptional decision is justified by the exceptional gravity of the announcements made on 15 September by Australia and the United States.”

Strained as relations were between Europe and the Trump administration over issues including climate change, Vladimir Putin’s Russia, and the role of the European Union, they never deteriorated to the point of the recall of a European ambassador.