G7 leaders close their summit on Monday with discussion of world problems including the fires ravaging the Amazon rainforest, but overshadowed by President Donald Trump's trade wars and questions over the group's unity.
The summit in Biarritz, a high-end surfers' paradise in southwestern France, saw a dramatic shift of focus Saturday when Iranian Foreign Minister Mohammad Javad Zarif flew in to discuss the diplomatic deadlock on Tehran's disputed nuclear programme.
Zarif's presence had not been expected and it represented a gamble by French host Emmanuel Macron who is seeking to soothe spiralling tensions between Iran and the United States.
The Iranian top diplomat didn't meet Trump, French diplomats said, but the presence of the two men in the same place at least sparked hopes of a detente. Just this July, the US government imposed heavy sanctions seeking to hamper Zarif's travel, and effectively banning him from the United States.
"Road ahead is difficult. But worth trying," the US-educated Zarif tweeted after meeting Macron and French Foreign Minister Jean-Yves Le Drian, as well as British and German representatives.
French officials said Trump, who has imposed crippling sanctions on the Iranian economy over its nuclear programme, had been aware of the arrival.
The sources suggested that the secretive visit had also been discussed during an impromptu two-hour lunch between the US president and Macron on Saturday.
"We work with full transparency with the Americans," one diplomat told reporters on condition of anonymity, despite US media reports that the White House had been taken by surprise.
Trump, who will give a press conference before returning to Washington on Monday, proclaimed that the G7 summit was going "beautifully" on Sunday.
Leaders of the G7 countries -- Britain, Canada, France, Germany, Italy, Japan and the United States -- ended their second day with another sumptuous dinner of the finest French cuisine. They also posed for a group photo with the ocean and Biarritz's tall lighthouse as a backdrop.
On the final day, the agenda included discussions of the fires destroying chunks of the Amazon, a scenario that European leaders have described as an assault on the so-called green lungs of the world.
Trump has been less vocal on the issue. He also stands out from the rest of the G7 in his budding friendship with Brazilian President Jair Bolsonaro, a former army officer who has given freer rein to industrial farmers and loggers who have made the country an agribusiness power -- at huge cost to the environment.
An even bigger issue dividing Trump from the rest of the G7 throughout the summit was trade and the US president's effort to force even close allies into hard negotiations on market access and tariffs.
Trump arrived in Biarritz fresh from having upped the ante with increased tariffs in the escalating trade struggle with China.
European leaders lined up to press for caution and on Sunday Trump gave a glimmer of hope that he was reconsidering his all-or-nothing approach to the dispute between the world's two biggest economies, when he appeared to admit he'd had "second thoughts" about the most recent escalation.
But only hours later, Trump's spokeswoman Stephanie Grisham did a 180 degree turn, saying the president had been misunderstood and that his real regret was not to have raised tariffs on China even more strongly.
At a breakfast meeting, British Prime Minister Boris Johnson became the latest of the G7 partners to urge Trump to step back from trade wars that critics fear could tip the world economy into recession.
"Just to register a faint, sheep-like note of our view on the trade war -- we are in favour of trade peace on the whole," Johnson told Trump.
The meeting with Johnson, who is sometimes compared to a British version of the populist, nationalist Trump, also underlined the White House's sometimes chilly relations with the European Union.
Trump predicted that Johnson would manage to untangle the mess of Brexit and described the EU as "an anchor around their ankle".
The 73-year-old US leader then promised Johnson a "very big trade deal, bigger than we've ever had." He and Japanese Prime Minister Shinzo Abe separately announced that they had pencilled in a major bilateral trade deal that they hope to sign next month.
A closing joint press conference was scheduled for early Monday.