Iranian Foreign Affairs Minister Mohammad Javad Zarif landed on Sunday in the French seaside town of Biarritz, where leaders of the G7 nations – the United States, Canada, France, Germany, the United Kingdom, Italy and Japan – were holding their annual gathering.
Zarif immediately went into a three-and-a-half-hour meeting with France's Minister of Europe and Foreign Affairs Jean-Yves Le Drian. He spent half an hour of that with French President Emmanuel Macron.
"The discussions are positive and are ongoing," an official in Macron's office said afterwards.
Zarif's plane departed moments after the whirlwind meeting ended.
"Iran's active diplomacy in pursuit of constructive engagement
continues," Zarif tweeted on Sunday night.
"Road ahead is difficult. But worth trying," he added.
Macron decided to make the "surprise" invite after hosting a dinner of G7 leaders on Saturday night, officials said.
Macron, the host of this year's G7 summit, has been leading efforts to defuse tensions triggered by Trump's decision to exit the internationally-brokered 2015 Iran nuclear deal and reimpose sanctions against Tehran.
Macron met Zarif for rare talks in Paris on Friday on the eve of the summit. He has also held telephone talks with Iranian President Hassan Rouhani.
In a Twitter post before the meeting, a spokesman for Iran's foreign ministry said Zarif will "continue talks regarding the recent measures between the presidents of Iran and France" during his visit to Biarritz.
But "there will be no talks with the US delegation on this trip," said Abbas Mousavi.
After Zarif's departure, a French official said the invite had been made "in agreement with the United States, in perfect harmony", contrasting earlier assertions by a White House official that US President Donald Trump had not been warned before his arrival.
Al Jazeera's Assed Baig, reporting from Tehran, said Zarif's visit highlighted hunger from Iranian politicians – in particular, the Iranian president – to salvage the landmark accord, which offered Iran relief from global sanctions in exchange for curbs on its nuclear programme.
"[The negotiations are taking place] to save the reputations of those political leaders in Iran that backed this nuclear deal," he said from Tehran.
|Iran foreign minister makes surprise visit to G7 summit (2:12)|
Zarif's surprise visit played out against apparent divisions between Trump and Macron on how to deal with Iran.
Earlier on Sunday, Macron told LCI television that the G7 leaders had agreed on "what we wanted to say jointly on Iran".
Officials from the French presidency told news agencies the G7 leaders had discussed the issue over dinner on Saturday evening and agreed that Macron should hold talks and pass on messages to Iran.
Trump denied that shortly afterwards. Asked if he had signed off on a statement that Macron intends to give on behalf of the G7 on Iran, he said: "I haven't discussed this. No, I haven't."
He added: "We'll do our own outreach, but, you know, I can't stop people from talking. If they want to talk, they can talk."
Macron later appeared to backtrack on his team's comments, saying there was no formal mandate from the G7 leaders.
"Yesterday, we had a discussion from which two priorities emerged. First of all, no member of the G7 wants Iran to ever get a nuclear weapon. Second, all members of the G7 are deeply committed to stability and peace in the region and therefore want to avoid actions that could compromise that," he said.
"The G7 is an informal group. There is no formal mandate given to anyone in this context. We will each continue to take initiatives to reach our two goals, that's what's important. The outcome of yesterday's discussions is that we will continue to all act, each in their own way."
On Sunday night, German Prime Minister Angela Merkel described the meeting as a "parallel event" that did not directly relate to the G7, although she said any attempts to de-escalate tensions with Iran over the nuclear deal were worthwhile.
Trump pulled the US out of the accord last year, saying he wanted to force Tehran into a new negotiation that would include its ballistic missile programme and regional activities. Since then, Washington has reimposed punishing sanctions on Iran's oil and banking sectors, triggering an economic crisis in the country.
The pact's remaining signatories – France, Germany, UK, China and Russia – oppose the US move, but have struggled to protect Iran from the US sanctions.
A year after the US exit, Tehran began scaling back some of its commitments under the accord, demanding European nations do more to deliver on the promised economic benefits, including selling its oil.
Macron has urged Trump to offer some sort of relief to Iran, such as lifting sanctions on oil sales to China and India, or a new credit line to enable exports, according to the AFP.
"To start this approach we need President Trump to agree with the idea that we need to make a pause [in the maximum pressure policy]," a French diplomat told reporters last week.
This is seen as a first step to get Iran back to the negotiating table, which could then lead to a new international agreement to limit its nuclear programme.
Zarif told AFP last week that Macron's suggestions were "moving in the right direction, although we are definitely not there yet".
Al Jazeera and news agencies