FOR a moment, the Group of Seven (G7) leaders attending their annual summit, in a mountain village in Quebec, looked like they had managed to paper over their differences with President Donald Trump and present a united front. They found just the right wording to secure American agreement on matters that never used to be in question, such as supporting democracy, abiding by international-trade rules and fighting terrorism. Even Mr Trump professed himself pleased, calling the summit wonderful and rating his relationships with other leaders as ten out of ten.

Yet barely ten minutes after the official communiqué was published, he changed his mind. He tweeted from somewhere over the Atlantic, en route to his “mission of peace” in Singapore with Kim Jong Un, North Korea’s despotic ruler, that he had instructed his officials not to endorse the communiqué. He attacked Justin Trudeau, Canada’s prime minister and host of the summit, for making “false statements” at his closing news conference, and renewed his threat to impose tariffs on automobiles supposedly “flooding the U.S. Market!”.

It was a confusing outcome all round. A flummoxed spokesman said Mr Trudeau had said nothing at the news conference he had not already said before to Mr Trump, both publicly and privately. It was unclear whether Mr Trump’s reversal was because of Mr Trudeau’s confirmation that Canada would retaliate against America’s steel and aluminium tariffs (the two leaders had already discussed this). Or was it a rejection of Mr Trump’s claim that a new deal for a North American Free-Trade Agreement (NAFTA) would have a sunset clause? (This was also discussed, though it seems plausible that Mr Trump believed the Canadians to be moving closer to some sort of compromise.)

During the summit itself, which Mr Trump left early, the tone had been conciliatory. The other leaders spoke warm words of support for Mr Trump’s effort to persuade North Korea to give up nuclear weapons. There were even signs that the group had overcome their differences regarding Russia. Before leaving Washington, Mr Trump had said that Russia should be readmitted to the group that had excluded it in 2014 after its invasion of eastern Ukraine and annexation of Crimea. But in the end there was no invitation to join the group next year in Biarritz, France, and the final communiqué called on Russia to stop destabilising democratic regimes and start living up to its international obligations as a member of the UN Security Council.

On trade, at one point it seemed as though Mr Trump was in search of some sort of grand bargain, as he called for the end of all subsidies, tariffs and non-tariff barriers to trade. But this was more an indication of how poorly Mr Trump understands the global trading system than a serious summons to the negotiating table. Even so, combing through the joint communiqué, signs of genuine co-operation were to be found, including a commitment to agree on new rules regarding “market-distorting subsidies” and state-owned enterprises.

After all that, Mr Trump’s trans-Pacific tweets struck an incendiary note. But his combination of bullying rhetoric and aggrieved victimhood is well-known. His threat to raise tariffs on cars is not new. An official investigation into whether cars are a threat to America’s national security was launched weeks ago. Nor is this the first time Mr Trump has railed against Canadian tariffs on dairy products. Mr Trudeau’s unwillingness to accept a hard sunset clause for NAFTA, or to accept American tariffs on steel and aluminium without retaliation, were also already clear.

It is perhaps more surprising that Mr Trump still faces people who think he can be persuaded by facts. The Cirque du Soleil performers who entertained the G7 leaders on Friday evening were not the only ones tying themselves in knots. At the meeting, Mr Trump’s counterparts brought binders of figures to the session devoted to trade in an attempt to persuade him that his belief that the rest of the world was unfair to America was mistaken. Tellingly, the desk in front of Mr Trump was bare. He later told reporters the others had been smiling at him as if they could not believe they had got away with using America as a “piggy bank” for so long. “The gig is up,” he said.

Correction (June 12th 2018): We originally wrote that Mr Trump sent his inflammatory, post-summit tweet from somewhere over the Pacific. In fact, Air Force One travelled in the other direction and was probably over the Atlantic when he was typing.