WASHINGTON, Aug. 26 (CGTN) -- U.S. President Donald Trump said on Monday at the G7 summit that he is prepared to meet his Iranian counterpart within weeks in what would amount to a stunning change of direction in the two countries' smoldering standoff.

The potential breakthrough was announced by Trump and French President Emmanuel Macron, who said he would facilitate the first face-to-face meeting between the U.S. president and the Iranians.

The surprise news came after Iranian Foreign Minister Mohammad Javad Zarif made a dramatic, unscheduled appearance on the sidelines of the summit held in Biarritz on Sunday at the invitation of Macron.

The 41-year-old French leader said the "conditions for a meeting" between Trump and Iran's Hassan Rouhani "in the next few weeks" had been created through intensive diplomacy and consultations.

"If the circumstances were correct, I would certainly agree to that," Trump said at a press conference with Macron at the end of three days of G7 talks.

Asked if he thought the timeline proposed by his French counterpart sounded realistic, Trump replied: "It does."

Trump was equally confident that Rouhani would be in favor.

"I think he's going to want to meet. I think Iran wants to get this situation straightened out," he added.

Both men will be in New York for the UN General Assembly at the end of September which could provide the stage for the talks.

Trump has put in place a policy of "maximum pressure" on Tehran over its disputed nuclear program via crippling sanctions that critics see as raising the risk of conflict in the Middle East between the United States and Iran.

The U.S. 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. Trump said the deal gave the Iranians cover to keep pursuing a secret nuclear military program which they insist does not exist.

Rouhani signals readiness for talks

Rouhani appeared to accept the idea of opening to talks with Washington.

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

"If I know that in meeting with somebody the problem of my country would be solved, I wouldn’t hesitate because the central issue is the national interests of the country,” Rouhani said, according to the official presidency website.

Macron has urged the U.S. administration to offer some sort of sanction relief to Iran. In return, Iran would return to complying with the 2015 deal.

Commenting on the talks about Iran at the G7, German Chancellor Angela Merkel said: "It's a big step forward. Now there is an atmosphere in which talks are welcomed."

G7 issues joint declaration on trade, Iran

The G7 meeting concluded on Monday in Biarritz without a customary joint communique, but a one-page declaration to "underline their great unity and the positive spirit of the debates."

The document focuses on trade, Iran, Ukraine and Libya.

"The G7 is committed to open and fair world trade and to the stability of the global economy," said the declaration.

"Therefore, the G7 wishes to overhaul the WTO (World Trade Organization) to improve effectiveness with regard to intellectual property protection, to settle disputes more swiftly and to eliminate unfair trade practices," the declaration read.

On Iran, the leaders of the group said they fully share two objectives: to ensure that Iran never acquires nuclear weapons and to foster peace and stability in the region.

The document said France and Germany will hold a summit in Normandy format in the coming weeks in order to achieve concrete results and leaders of the group support a truce in Libya that can lead to a lasting ceasefire.