BIARRITZ, France — He was not on the original invitation list, but when a plane landed in Biarritz on Sunday bringing Iran’s foreign minister to the city hosting President Trump and other world leaders, it got everyone’s attention.
The surprise guest, Mohammad Javad Zarif, flew to the resort town in southern France on a last-minute invitation from President Emmanuel Macron of France, the host of the annual Group of 7 summit meeting, who has been trying to reconcile the United States and Iran.
Mr. Zarif was meeting with France’s foreign minister, Jean-Yves Le Drian, and not invited to attend any of the formal Group of 7 sessions, nor was he to meet with any American officials while here, according to French and Iranian officials. But his presence was an unexpected twist in a conflict that has escalated in recent months with a string of episodes involving tankers and drones near Iran.
A senior French official insisted that Mr. Trump was given advance warning. Treasury Secretary Steven Mnuchin, speaking with reporters, would not discuss Mr. Zarif’s visit, but did make a point of repeating Mr. Trump’s occasional expressions of willingness to talk with Tehran.
“The president has said before that to the extent Iran wants to sit down and negotiate, he would not set preconditions to those negotiations,” Mr. Mnuchin said. “I’m not going to make any more comments about who’s here and who’s not here and what conversations may or may not be going on.”
Mr. Zarif met with Mr. Le Drian for more than three hours at the Biarritz town hall and Mr. Macron joined for the last 30 minutes, the French official said. Mr. Zarif said later that he also briefed officials from Britain and Germany.
“Iran’s active diplomacy in pursuit of constructive engagement continues,” he wrote on Twitter. “Road ahead is difficult. But worth trying.”
European officials have kept up a dialogue with Iran even after Mr. Trump last year abandoned the 2015 nuclear agreement that constrained its nuclear program in exchange for the lifting of sanctions.
Even as Mr. Trump reimposed sanctions as part of a “maximum pressure” campaign against Tehran, Mr. Macron and his counterparts in Britain and Germany have sought to salvage the nuclear deal. But Iran lately has begun moving toward exceeding the limits of the deal.
Iranian officials told Reuters on Sunday that Tehran would insist on being allowed to sell at least 700,000 barrels of oil a day as a good-will gesture to discuss saving the nuclear agreement. Moreover, they said, Iran would refuse to negotiate over the country’s ballistic missile program or right to enrich uranium, conditions that would almost certainly be unacceptable to the Trump administration.
Mr. Trump has talked tough about Iran’s recent actions but pulled back from targeted airstrikes to retaliate for the downing of an unmanned American surveillance drone in June. He has offered generally restrained responses to Iran’s seizure of a British-flagged oil tanker in the Persian Gulf and its test of a medium-range ballistic missile. The administration also extended waivers on sanctions over the objections of Iran hawks.
In July, Mr. Trump gave his blessing to Senator Rand Paul, Republican of Kentucky, to meet with Mr. Zarif in New York. During that meeting, according to The New Yorker, Mr. Paul extended an invitation to Mr. Zarif to the Oval Office.
But the diplomatic overture quickly soured amid continuing tension in the region and Mr. Trump’s administration imposed sanctions on Mr. Zarif, drawing criticism from Mr. Paul for disrupting diplomacy.
Mr. Zarif was in Paris on Friday to meet with Mr. Macron just before the start of the Group of 7 meeting. A senior French official said that Mr. Macron decided to invite Mr. Zarif to Biarritz on Saturday evening after the Group of 7 leaders had shown “points of agreement” on the Iran discussions during a dinner.
The leaders, the official said, all agreed on not wanting Iran to obtain a nuclear weapon, and on the need for stability in the Middle East. The official said that France worked “in full transparency” with the United States and its European partners and that Mr. Macron discussed Iran at length with Mr. Trump during their lunch on Saturday.
On Sunday, Mr. Macron said the Group of 7 leaders had agreed on a common outreach to Iran.
“There is a G-7 message on our objectives,” he told French television. “We all agree on two very clear things — we do not want Iran to get the nuclear bomb and we do not want an escalation and destabilization of the region.”
But asked about that later by reporters, Mr. Trump said he had not signed on to such a joint message.
“No, I haven’t discussed that,” he said.
He offered no public objection to Mr. Macron’s outreach to Iran.
“But we’ll do our own outreach,” he said. “But you know, I can’t stop people from talking. If they want to talk, they can talk.”
The foreign minister’s visit came a day after Iranian media reported that the government has imposed sanctions on the Foundation for Defense of Democracies, a Washington-based organization that has been highly critical of the nuclear agreement and supported the Trump administration’s hard-line approach.
The foundation’s chief executive, Mark Dubowitz, called on Mr. Trump and Mr. Emmanuel to warn Mr. Zarif that he can be barred from attending meetings of the United Nations General Assembly, or UNGA.
“While @JZarif & his regime threatening to unleash their security apparatus against American citizens at @FDD, he is being welcomed to #G7Biarritz,” Mr. Dubowitz wrote on Twitter. “I hope @realDonaldTrump and @EmmanuelMacron making clear to him that further threats will lead to his banishment including from UNGA.”