But the president’s move suggested that neither previous agreements nor political alliances would guarantee insulation from Mr. Trump’s trade wars. Brazil and Argentina are also facing serious economic troubles, but those too were no defense.

The new clash with South America came on the same day that a report from the Office of the United States Trade Representative declared a French tax on technology so onerous that retaliatory tariffs as high as 100 percent on French wines, cheeses and handbags would be justified. The report did not impose such tariffs but cleared the way for Mr. Trump to do so if he chooses.

Mr. Trump’s announcement on steel and aluminum was particularly jarring to Brazil’s conservative populist president, Jair Bolsonaro, who had gone to great lengths to strengthen ties with the Trump administration, with little to show for it.

“Aluminum?” Mr. Bolsonaro asked when reporters presented him with Mr. Trump’s tweet. “If that’s the case, I’ll call Trump. I have an open channel with him.”

Dante Sica, Argentina’s minister of production, called the move “completely unexpected.”

“I was in Washington last week, and I talked to a lot of people, and there was no sign whatsoever that there would be any kind of change,” he said.