Iran’s foreign minister, Mohammad Javad Zarif, has made a surprise appearance in Biarritz meeting Emmanuel Macron, in the midst of a G7 summit where western policy towards Iran has been one of the most contentious issues.

On Sunday evening, Zarif posted a picture on Twitter of his meeting with the French president and the foreign minister, Jean-Yves Le Drian, reportedly in the office of the Biarritz mayor, across the road from a building where G7 leaders had been meeting. The Iranian foreign minister said he had also provided a briefing for British and German officials.

“Road ahead is difficult. But worth trying,” Zarif wrote, before flying out of Biarritz on Sunday evening.

A senior French diplomat confirmed that Zarif had been invited to Biarritz for talks as part of Macron’s diplomatic initiative aimed at defusing tensions in the Gulf and reviving diplomacy with Iran. Zarif also met Macron in Paris on Friday.

“We have been trying for several months to defuse tensions and create a pause for useful negotiations,” the French diplomat said. He added that the French were not acting as mediators for the US, and it was not the intention “at this stage” to bring together the Iranians and Americans.

The diplomat said Zarif was not formally a guest of the G7 but that Macron had informed other leaders at the summit, including Donald Trump.

“The president had a conversation yesterday with all the G7 leaders and clearly the information was circulated,” the diplomat said. “Our diplomats are working in full transparency with the United States.”

Asked for his reaction to Zarif’s arrival, Trump said only “no comment”. The US treasury secretary, Stephen Mnuchin suggested the US president would not rule out a meeting.

“The president has said before that to the extent Iran wants to sit down and negotiate, he would not set pre-conditions to those negotiations,” Mnuchin said.

Earlier on Sunday, Macron had floated a plan at the summit to defuse rising tensions in the Gulf by partially lifting the US oil embargo on Iran in exchange for Tehran’s return to full compliance with the 2015 nuclear agreement restricting its nuclear programme.

The French diplomat said that once tensions had been reduced, an opening would be created for talks on other issues, including regional conflicts and Iran’s ballistic missile programme.

Donald Trump was noncommittal. Asked for his reaction, the US president said he had not discussed the proposal with Macron. However, European officials confirmed Macron had talked about leading a diplomatic initiative on Iran during a Saturday night dinner of G7 leaders.

Emmanuel Macron and Donald Trump with other world leaders at the G7 summit. Photograph: Philippe Wojazer/AP

Sitting alongside the Japanese prime minister, Shinzo Abe, who made an abortive attempt to mediate between the US and Iran in June, Trump said: “I also support Prime Minister Abe’s outreach, because he’s also speaking to Iran … We’ll do our own outreach. But you can’t stop people from talking. If they want to talk, they can talk.”

US officials insisted the US policy of “maximum pressure” on Iran was working and had international support.

“The G7 countries all agreed the president’s maximum pressure campaign on Iran is having an impact, and that it should continue,” an official familiar with the talks said.

Trump is accompanied in Biarritz by his hawkish national security adviser, John Bolton, who has opposed any easing of the “maximum pressure” campaign, intended to force its government to halt nuclear activities such as uranium enrichment entirely.

Under the 2015 joint comprehensive programme of action (JCPOA), Iran accepted strict curbs on its activities in return for sanctions relief.

Q&A What is Iran's nuclear enrichment cap? Show Under the joint comprehensive plan of action signed in 2015, Iran is only permitted to produce low-enriched uranium. This is uranium that has a concentration of 3%-4% of the isotope U-235. This isotype is a fissile material, which is capable of sustaining a nuclear fission chain reaction. At this low level of enrichment, it can be used to produce fuel for nuclear power plants. Iran is permitted to stockpile 300kg of it, at an enrichment level capped at 3.67%. A bomb needs uranium that is up to 90% enriched. Iran’s atomic energy agency has said production of enriched uranium has been quadrupled. The more that uranium is enriched, the faster it is to enrich it further. Iran argues that it is no longer bound by the cap because of the withdrawal of the US from the agreement, and the reimposition of economic sanctions Donald Trump.

Read more: Iran's uranium enrichment programme: the science explained

Trump withdrew the US from the agreement in May 2018 and has since steadily increased sanctions against Iran. In response, Iran has begun gradually to break out of the JCPOA limits, increasing its stock of low enriched uranium for example, and raising the level at which it enriches uranium. Iranian forces have also stepped up the harassment of oil shipping going through the strait of Hormuz.

“We think it is necessary to usefully contribute towards creating conditions for a defusing of tensions and create an opening for talks not only to get Iran back into compliance with the JCPOA but to break the impasse threatening regional stability,” a French diplomat said.

The other parties to the JCPOA – the UK, France, Germany, Russia, China and the EU – have urged both the US and Iran to return to the agreement.

French officials were optimistic they could persuade the US that Macron’s plan was a better alternative to a drift towards a new Middle East conflict. They say it would create a breathing space for talks about issues such as Iran’s ballistic missile programme and its involvement in regional conflicts.

Zarif, who held talks with Macron in Paris on the eve of the summit, has said the French initiative is moving “in the right direction”.

Such diplomacy could face resistance from Iran’s supreme leader, Ali Khamenei, and hardliners in the powerful Revolutionary Guards, who insist the missile programme and Iran’s regional role are not negotiable.