BIARRITZ, France — For a day, at least, everyone was on their best behavior when the cameras were on, eager to present a show of bonhomie after so many previous meetings ended in discord.
But behind the scenes at the annual gathering of some of the world’s leading powers, President Trump still found himself at odds with his counterparts on Sunday over issues like trade, climate change, North Korea, Russia and Iran.
Ever so gingerly, as if determined not to rouse the American’s well-known temper, the other Group of 7 leaders sought to nudge him toward their views on the pressing issues of the day, or at least register their differences — while making sure to wrap them in a French crepe of flattery, as they know he prefers.
It was far from clear the messages were received, or in any case at least welcome.
Like other presidents, and perhaps even more so, Mr. Trump tends to hear what he wants to hear at settings like this, either tuning out contrary voices or disregarding them. Through hard experience, other leaders have concluded that direct confrontation can backfire, so they have taken to soft-pedaling disagreements.
Even Trump favorites like Boris Johnson, the populist new prime minister of Britain, tread carefully. On Sunday, Mr. Johnson expressed qualms about Mr. Trump’s trade war with China, but appeared to take pains not to offend the easily offended president.
As the two met for the first time since the new prime minister’s installation a month ago, Mr. Trump said none of the other leaders in Biarritz had expressed concern about his guns-blazing trade war.
“No, not at all,” he said. “I haven’t heard that at all, no. I think they respect the trade war.” He added: “The answer is, nobody has told me that, and nobody would tell me that.”
But Mr. Johnson proceeded to tell him exactly that, while characterizing it oh-so-deferentially as a “faint, sheeplike” dissent. “We’re in favor of trade peace on the whole, and dialing it down if we can,” the prime minister said.
For his part, Mr. Trump largely stuck to diplomatic niceties, refraining from hate-tweeting his colleagues and leaving aside his caustic complaints about their military spending, economic policies or even French wine. He did not repeat his aides’ criticism of France for focusing the meeting on “niche issues” like climate change and African development rather than the global economy.
While the president relishes confrontation, he tends to avoid conflict in person, saving his vitriol for long-distance social media blasts.
No one can say how the remainder of the meetings will go, or what will happen after he leaves. But everyone seemed determined to avoid the sort of blowup that marred last year’s Group of 7 meeting in Canada, when a stormy Mr. Trump refused to sign the final communiqué and lashed out at the host, Prime Minister Justin Trudeau.
“Thus far, this has been really a great G-7,” Mr. Trump gushed on Sunday, “and I want to congratulate France and your president because they have really done a great job.”
The lunch he had with President Emmanuel Macron was “the best hour and a half I’ve ever spent with him,” he said, and the dinner on Saturday with the other leaders “was fantastic.” And Prime Minister Johnson, he said, was “the right man for the job.”
Still, even by Mr. Trump’s own account, the dinner did include a “lively” discussion about his desire to invite Russia to return five years after it was expelled from what was then called the Group of 8 for annexing Crimea through force of arms. The other leaders have rejected doing so until Russia reverses its intervention in Ukraine, saying it would reward aggression.
As host of next year’s Group of 7 meeting, to be held in the United States, Mr. Trump could theoretically invite Russia to attend as an observer, but he said he had not made up his mind about that yet.
“I think it’s advantageous,” he said. “I think it’s a positive. Other people agree with me, and some people don’t necessarily agree.”
The dinner discussion on Saturday night also focused on Iran, an issue on which Mr. Trump broke with American allies by abandoning the 2015 nuclear deal with Tehran. Mr. Macron, who has tried to resolve the dispute, emerged thinking he had a consensus to convey to Iran: that the leaders agreed it should not have a nuclear weapon or destabilize the region.
But when Mr. Trump was asked about that on Sunday, he looked blank, as if he did not recall such a conversation.
“No, I haven’t discussed that,” he said. Within hours, the Iranian foreign minister was making a surprise visit to Biarritz, invited by Mr. Macron, while American officials maintained a grim silence.
The president likewise found himself striking a different note than Prime Minister Shinzo Abe of Japan regarding the recent string of short-range missile tests by North Korea’s leader, Kim Jong-un. Mr. Trump brushed them off, saying that while he was “not happy” about them, “he’s not in violation of an agreement.”
By that, Mr. Trump meant that Mr. Kim had not violated the understanding the two leaders had when they first met a year ago in Singapore that North Korea would not test long-range ballistic missiles or nuclear explosives.
But while Mr. Trump may not care about short-range missiles, Mr. Abe does, since they can easily reach Japan. He pointed out that the recent round of tests “clearly violates the relevant U.N. Security Council resolutions” and called them “extremely regrettable.”
Still, as the two agreed on principles for a new trade pact, Mr. Abe, too, sought to avert a rupture with Mr. Trump.
“I would like to make sure that we — meaning, myself and President Trump — will always stay on the same page when it comes to North Korea,” he said.
“Ultimately, we’re always on the same page,” Mr. Trump agreed.
In his inaugural encounter with Mr. Trump as peers, Mr. Johnson demonstrated that he had learned from the difficulties his predecessor had with the American president. Even as he spoke out on the trade wars, Mr. Johnson was careful to first heap praise on Mr. Trump.
“Look, I just want to say I congratulate the president on everything that the American economy is achieving,” Mr. Johnson said. “It’s fantastic to see that.”
Having dispensed with the compliments, he noted his country’s experience on trade.
“The U.K. has profited massively in the last 200 years from free trade and that’s what we want to see,” Mr. Johnson said. “We don’t like tariffs on the whole.”
Mr. Trump took it in stride, but could not restrain himself entirely from poking back.
“How about the last three years?” he said, challenging Mr. Johnson with a smile and referring to Britain’s anemic economy of late. “Don’t talk about the last three. Two hundred, I agree with you.”
Mr. Johnson laughed and left it at that. Any further disagreement would wait until the cameras left the room.