The White House did not know about the invitation in advance and Mr Trump said he had "no comment" on the diplomat's presence. They explained Iran's top diplomat was invited to the G7 summit in Biarritz by France. The US president appeared to be at odds with his French opposite number over a proposed message French officials said Mr Macron would deliver to Iran.
Mr Trump denied he had signed off on any such message, telling reporters, "No, I haven't discussed that," during a meeting with Japanese Prime Minister Shinzo Abe.
The Trump administration was not aware in advance of the invitation to Mohammad Javad Zarif for talks on the sidelines and the president curtly told reporters he had "no comment" on the Iranian foreign minister's presence.
Mr Zarif jetted out on Sunday evening following talks with French President Emmanuel Macron, who extended the invite.
The purpose of the unannounced visit and talks, French officials said, was to lower tensions stoked by the re-imposition of sanctions on Iran following the US withdrawal from the Iran nuclear treaty and the seizure of two oil tankers.
Mr Macron has championed European efforts to keep the 2015 agreement alive after President Trump pulled the US out last year.
The US President declined to comment on Sunday after a flight tracking website reported an Iranian government plane had arrived in the southwestern French town of Biarritz where G7 leaders are meeting.
The office of French President Emmanuel Macron, who is hosting the G7 summit, declined to comment as did the French foreign ministry.
European leaders have struggled to calm a deepening confrontation between Iran and the United States since Trump pulled his country out of Iran’s internationally brokered 2015 nuclear deal and reimposed sanctions on the Iranian economy.
Earlier on Sunday at the G7 summit, Trump appeared to brush aside French efforts to mediate with Iran, saying that while he was happy for Paris to reach out to Tehran to defuse tensions he would carry on with his own initiatives.
France said G7 leaders had agreed that Macron should hold talks and pass on messages to Iran.
However, Trump, who has pushed a maximum pressure policy on Iran, distanced himself from the proposal, saying he had not even discussed it.
Under the nuclear deal that Mr Trump has withdrawn from, the brainchild of Barack Obama, Tehran agreed to limit its sensitive nuclear activities and allow in international inspectors in return for the lifting of crippling economic sanctions.
Mr Trump has since reimposed severe sanctions, limiting Iran's ability to sell its main export, oil, plunging the country's economy into turmoil.
White House officials said Mr Trump was noncommittal when the leaders discussed the subject of a message to Iran during a conversation about Iran's nuclear programme.
Mr Macron only decided to invite Mr Zarif, who is subject to US sanctions himself, to Biarritz after meeting him for the first time on Friday.
Tensions have also been building between Iran and the West over the seizures of two ships, one Iranian near Gibraltar and the other British-flagged in the Strait of Hormuz, last month.
The Iranian ship, the Grace 1, seized by British forces, has since been released, but the British-flagged Stena Impero, which Iran captured in an apparent tit-for-tat move, is still being held.
Looking to broaden the gathering, Macron invited several African leaders to discuss problems facing their continent, while leaders from India, Australia, Chile and Spain joined the group for dinner on Sunday where the focus was on the environment and other issues.
However, senior U.S. officials accused Macron of looking “to fracture the G7” by focusing on “niche issues” rather than major global concerns.
France denied this, pointing to Sunday’s initial session covering the economy, trade and security, areas that used to draw easy consensus but are now sources of great friction.
Trump up-ended last year’s G7 meeting in Canada, walking out early and disassociating himself from the final communique.
Amid the wrangling this time around, some potential positives emerged, with Trump and Japanese Prime Minister Shinzo Abe agreeing in principle to core elements of a trade deal.
Trump said: "It’s billions and billions of dollars.
"Tremendous for the farmers.”
However, the two men appeared at odds over North Korea’s series of short-range missile launches.