BIARRITZ, France — President Trump offered deeply contradictory signals about his trade war with China on Sunday, ending the day by escalating his threats of higher tariffs even as he remained isolated from fellow world leaders on a strategy that has rattled the global economy.

A day after defending his authority to order American companies out of China, Mr. Trump started Sunday by conceding that he was having “second thoughts” about a new round of levies on Chinese goods. Within hours, he abruptly reversed himself again, saying that he only regretted not raising tariffs even higher.

The president’s rhetorical whipsaw came against the backdrop of tense but cordial meetings in Biarritz, France. It injected fresh uncertainty into Mr. Trump’s efforts to try to change Chinese behavior by gambling on the fate of hundreds of billions of dollars in products that flow between the two countries.

“I think they respect the trade war,” Mr. Trump said of his allies assembled here for the Group of 7 annual gathering. Of China, he said: “What they’ve done is outrageous, that presidents and administrations allowed them to get away with taking hundreds of billions of dollars out every year.”