US President Donald Trump said Monday he had agreed to the Iranian foreign minister flying in for a G7 summit and insisted he was not seeking regime change in Tehran -- a change of tone that could lower tensions.

Mohammad Javad Zarif made a surprise appearance at the summit in Biarritz on Sunday for talks with French President Emmanuel Macron, who is seeking to broker a deal between Iran and the United States.

Zarif also met with French and other European diplomats, but Trump said it was "too soon" for him to meet Zarif.

"I knew everything he (Macron) was doing and I approved everything he was doing," Trump said, adding that the French president "asked for my approval".

In early August, Trump lambasted Macron for sending "mixed signals" on Iran, and at the end of July the US administration imposed sanctions on Zarif.

Trump has put in place a policy of "maximum pressure" on Tehran over its disputed nuclear programme via crippling sanctions that are seen as raising the risk of conflict in the Middle East.

The US president last year unilaterally pulled out of a landmark 2015 international deal that placed limits on Tehran's nuclear activities in exchange for trade, investment and sanctions relief.

"I believe that for our country's national interests we must use any tool," Iran's President Hassan Rouhani said of Zarif's Biarritz visit in a speech aired live on state television on Monday.

But hardliners criticised the initiative, with the ultra-conservative Kayhan newspaper saying the trip was "improper" and sent "a message of weakness and desperation."

Trade war worries

Trump, who is to give a press conference before returning to Washington on Monday, proclaimed Sunday that the G7 summit was going "beautifully".

The G7 is a elite club of rich democracies comprising Britain, Canada, France, Germany, Italy, Japan and the United States.

Macron's priority for the three days of talks had been to help paper over divisions between them and tackle global crises, including the fires blazing in the Amazon rainforest.

On the Iranian issue, Trump said that there was "great unity" and that "we've come to a conclusion, more or less."

Commenting on his escalating trade war with China, Trump said Chinese officials had made contact on Saturday night to propose talks.

"I can say we are having very meaningful talks, much more meaningful, I would say, than at any time," he said at a press conference with German Chancellor Angela Merkel.

"It's because we are doing very well... they are losing millions and millions of jobs, they're going to other countries and if I was them, I'd want to make a deal," he said.

"China called last night... said let's get back to the table. So we'll be getting back to the table," Trump told reporters.

He arrived in the famed surf town of Biarritz on Saturday shortly after upping the ante with increased tariffs on Chinese goods.

European leaders have lined up to urge caution and warn about the danger of recession from the conflict.

Trump gave a glimmer of hope on Sunday that he was reconsidering his all-or-nothing approach to the dispute between the world's two biggest economies.

He appeared to admit he had 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 raising tariffs on China even more strongly.

Amazon help

On the final day, the G7 agenda includes 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 leaders 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 a huge cost to the environment.

But on Monday, the French presidency announced that G7 leaders had agreed to provide 20 million euros ($22.2 million) to help Brazil's efforts, mainly to finance the deployment of more Canadair water-dumping planes.

British Prime Minister Boris Johnson had pledged earlier Monday £10 million ($12.3 million) to help Amazon reforestation efforts, including in areas hit by the fires.

Macron has threatened to block an extensive new trade deal between the European Union and Latin America unless Bolsonaro takes more serious steps to combat global warming.