There was a moment at the G7 when a summit between the presidents of the U.S. and Iran seemed tantalizingly possible.

From the Group of Seven meeting in Biarritz, France, U.S. President Donald Trump said he was open to the idea, raised by his host, French President Emmanuel Macron. For good measure, Trump conferred his highest compliment on his Iranian counterpart, Hassan Rouhani: "I tell you one thing, he's a great negotiator."

From Tehran, Rouhani signaled his own readiness. "If I know that meeting someone will lead to the progress of my country and resolve the problems of the people, I will not hold back," he said on Iranian TV.

A day later, Rouhani unwisely abandoned that principle, sneering that any such meeting would be no more than a photo-op. He returned to his previous position that there could be no negotiation with the U.S. until American sanctions were lifted.

Given the nature of the regime in Tehran, it's a safe bet that Rouhani's about-face was ordered by the supreme leader, Ali Khamenei, who has consistently dismissed any talk of talks with the U.S.

This intransigence is both ill-conceived and self-defeating. The sanctions have imposed great pain on the Iranian economy and hardship on its people. The regime has only made matters worse by recklessly resuming uranium enrichment and endangering civilian shipping in the Persian Gulf. Now it has rejected mediation efforts by two leaders of international stature.

Iran should recognize that it's short on support and running out of leverage. Its negotiating position will hardly improve as its economy deteriorates and Western countries unite to oppose its maritime misadventures. If anything, Trump has been all too open to — on several occasions, even offering to sit down without preconditions — and the regime should accept that such talks are a necessary step toward ending this dangerous confrontation.

Of course, Iran feels betrayed by Trump's abrogation of the 2015 nuclear deal, and has been demanding that the other signatories — especially the Europeans — set things right. The U.S., too, has demands: It wants a new deal that would end not only Iran's nuclear ambitions, but also its ballistic-missile program and other destabilizing activities.

Reconciling these positions will take a great deal of diplomatic effort, and Iran should seize any opportunity to start that process. It doesn't take a "great negotiator" to see that such discussions are a necessary first step to resolving seemingly irresolvable conflicts. If that means accepting a photo-op with Trump, it is a very low price to pay.

— Bloomberg Opinion