BIARRITZ, France — A summit of world leaders devolved into a confusing spectacle on Sunday when President Trump signaled regret for his trade war with China only to have the White House reverse his position hours later.

It was one of numerous surprises on a day when some officials had hoped for clarity or consensus. Leaders continued squabbling about whether Russian President Vladi­mir Putin would attend a future meeting, and French officials surprised others by inviting Iran’s foreign minister to this seaside town, an unusual move of diplomatic jujitsu in the tightly scripted world of international summits.

Leaders who were hoping that global tensions over trade, North Korea and China might be eased on the second day of the Group of Seven summit were disappointed during a whiplash day of mixed signals. Some European officials said they were beginning to fear that nearly any substantive coordinated work with the United States might be impossible in the Trump era.

Trump has so far done little to publicly inflame tensions with other leaders as he has during past summits, where he has lobbed insults or threatened to withdraw from international organizations. But on this trip he has also done little to assuage concerns that the United States would continue to act unilaterally, particularly related to tariffs, regardless of the economic impact.

“From the moment we got here, we’ve been treated beautifully,” Trump said during a meeting with Japanese Prime Minister Shinzo Abe before going on to compliment the job being done by French President Emmanuel Macron as host of the summit. “And I want to congratulate — and I have to say ‘thus far,’ because we’re probably halfway through. But thus far, this has been really a great G-7, and I want to congratulate France and your president because they have really done a great job.”

On Sunday morning, during a breakfast with British Prime Minister Boris Johnson, a reporter asked Trump if he had “second thoughts” about the recent escalation of his trade war with China. Trump has tried to cut a trade deal with China for more than a year, but those efforts unraveled recently and both sides ratcheted up attacks last week.

Trump, for the first time, appeared to acknowledge regrets about the direction things had gone. 

“Yeah, sure. Why not,” he said. “Might as well. I have second thoughts about everything.”

His comments drew international headlines. Several hours later, White House press secretary Stephanie Grisham tried to recast Trump’s comments, alleging they had been taken out of context.

“The president was asked if he had ‘any second thought on escalating the trade war with China.’ His answer has been greatly misinterpreted. President Trump responded in the affirmative — because he regrets not raising the tariffs higher,” she said in a statement.

Trump’s top economic adviser, Larry Kudlow, offered an even different characterization later, telling reporters that Trump had difficulty hearing the question.

It was the latest in a swing of reversals from the White House in the past week, over issues such as tax policy, attempting to purchase Greenland and — most notably — China.

Former treasury secretary Lawrence Summers, a veteran of the Clinton and Obama administrations, said the White House’s conflicting statements were just the latest in a string of mixed messages that had made it impossible for people to understand its agenda.

“Deeply misguided policy and strategy has been joined for some time by dubious negotiating tactics, with promises not kept and threats not carried out on a regular basis,” Summers said in an interview. “We are at a new stage now with very erratic presidential behavior and frequent denials of obvious reality. I know of no U.S. historical precedent.”

The G-7 summit is an annual gathering of economic powers that is meant to draw leaders together so they can attempt to address global tensions. But the summit has not had success bridging differences during the Trump administration.

At last year’s summit, held in Canada, Trump announced that he was withdrawing from a final agreement because he felt insulted by Canada’s prime minister, Justin Trudeau. Also at that summit, Trump tossed two candies in the direction of German Chancellor Angela Merkel, telling her, “Don’t say I never give you anything.”

In the run-up to this summit, European officials signaled they planned to tiptoe around Trump and avoid confrontation.

At the Sunday breakfast, Johnson — seen as a key White House ally — was the first leader at the meeting to publicly — although gingerly — question Trump’s approach to the trade war with China, which some believe is affecting the global economy.

“Just to register the faint, sheeplike note of our view on the trade war,” the British prime minister said, “we’re in favor of trade peace on the whole. … We think that, on the whole, the U.K. has profited massively in the last 200 years from free trade.”

Later, it was Abe’s turn.

A reporter asked Trump if he was concerned about a recent North Korean missile launch.

“We’re in the world of missiles, folks, whether you like it or not,” Trump said, adding that he understands why Abe is unhappy with the testing.

Abe made clear that he views North Korea’s move as a serious breach of international expectations for the rogue nation.

“Our position is very clear: that the launch of short-range ballistic missiles by North Korea clearly violates the relevant U.N. Security Council resolutions,” he said.

The remarks from foreign leaders didn’t appear coordinated, but they did reflect a growing comfort in pushing back — however slightly — in person to a U.S. leader who likes to be feted and praised wherever he goes.

Even the positive news Trump tried to roll out had some confusing elements. Trump told reporters that he had reached a trade deal with Japan that would be signed as soon as next month, but Abe said more work remained. Still, the announcement drew cheers from U.S. farm groups, who believed Trump had opened up access to a big Asian market.

The summit was later jolted by an afternoon surprise — the arrival of Iranian Foreign Minister Mohammad Javad Zarif. 

A number of White House officials were not aware that the French had invited the senior Iranian official, though it was unclear how much Trump had been briefed ahead of time. Trump pulled the United States last year from the 2015 Iranian nuclear agreement, undermining an accord that European leaders feel is core to their security interests. Macron has tried to broker new talks.

Asked if he was aware Zarif might fly into Biarritz on Sunday, Trump answered, “no comment.” Treasury Secretary Steven Mnuchin later told reporters that the United States would be open to meeting with Iranian officials but didn’t speculate as to whether or when that would happen.

As the summit continued Sunday, Trump’s interest appeared to wane. During an afternoon break, he posted items on Twitter that had little to do with the G-7. He wished a happy birthday, for example, to celebrities Regis Philbin and Sean Connery. He also quipped about his poll numbers and complained about his treatment by Fox News.

But all eyes have been on him over the past two days.

At a closed-door dinner Saturday night, leaders confronted Trump over his suggestion that Putin join next year’s installment of the summit, when it is in the United States, according to officials briefed on the discussions who agreed to describe them on the condition of anonymity.

The contentious exchange boiled down to whether leaders felt it was useful to have conversations purely among liberal democracies. Trump didn’t put any special weight on the format, officials said.

Trump told reporters on Sunday that there had not been a consensus about what he should do regarding Putin next year, and he said that some unnamed world leaders wanted Putin to attend.

He did not offer names, but a European official said later that Japan was neutral on the proposal and that Italy also offered little objection.

A live microphone captured a private conversation Sunday between Johnson and Macron, and Johnson appeared to remark about a tense moment on Saturday evening, the night of the Putin debate.

“You did very well there last night. My God, that was a difficult one,” Johnson told Macron on Sunday ahead of one meeting, pumping his fist.

“Bien joué,” the British leader said, using the French phrase for “well played.”

The summit is set to conclude on Monday afternoon. Trump will host next year’s G-7 in the United States, and he is leaving whether he will invite Putin as a cliffhanger.

“It’s certainly possible,” he said. “We’ll see.”