French President Emmanuel Macron masterfully works Donald Trump, perhaps better than any U.S. ally. By the end of the day Tuesday, it looked like he might—just might—prevent an angry showdown between the United States and Iran. Trump began the day by virtually declaring war on the Islamic Republic if the nuclear deal unravels and Tehran resumes uranium enrichment, a fuel process for both peaceful nuclear energy and bombs. “They’re not going to be restarting anything,” the President pronounced angrily, during an Oval Office photo opportunity with Macron. ”If they restart it, they’re gonna have big problems, bigger than they’ve ever had before. And you can mark it down.” He called the historic accord, finalized in 2015, between Iran and the world’s six major powers, “insane. It’s ridiculous. It should never have been made.”

But, in the afternoon, after talks with Macron, Trump was almost conciliatory. He even hinted, at a joint press conference with Macron, that the United States and its European allies could have “an agreement among ourselves very quickly. I think we’re fairly close to understanding each other.”

The French leader is trying to coax Trump into accepting an expanded compromise that would prevent him from pulling the U.S. out of the nuclear accord—a decision is due by May 12th—and address the White House’s concerns about Iran’s broader behavior. It would build on what exists to “fix it”—the language Trump uses—rather than revise it or renegotiate it from scratch. Macron said that the “four pillars” of such a compromise would focus on Tehran’s missile program and its meddling in the rest of the Middle East, notably in Syria, Iraq, and Yemen.

“The Iran deal is an important issue,” Macron said, during the morning photo opportunity. “But we have to take it as a part of the broader picture, which is security in the over-all region. And we have the Syrian situation. We have a common relation in Iraq. We have the stability to preserve for our allies in the region, and what we want to do is contain the Iranian presence in the region.” The Iran deal, he added, is just “part of this broader picture.”

For Trump, the appeal of Macron’s compromise is that it produces a formal consensus among Western powers about several Middle East hot spots in which Iran is involved. It’s a burden-sharing formula at a time when Iran represents the deepest policy division between the United States and Europe. Senior European diplomats have expressed concern that a formal split on the Iran deal would undermine the transatlantic alliance, which has been the foundation of relations since the Second World War. Trump sees Iran’s hand—and its military—behind virtually all major problems in the world’s most volatile region, as he made clear again on Tuesday. “It just seems that no matter where you go, especially in the Middle East, Iran is behind it,” he said in his morning appearance with Macron. “You look at the ballistic missiles that they’re going and testing. What kind of a deal is it where you’re allowed to test missiles all over the place? What kind of a deal is it when you don’t talk about Yemen, and you don’t talk about all of the other problems we have with respect to Iran, especially look at what they’re doing in Iraq.”

The compromise has its limits, however, according to European envoys. It involves an agreement between only the four Western signatories—not China and Russia, which were equal parties to the nuclear deal. It spells out how the West interprets the accord but does not formally change any of its language. For the White House, the most sensitive issue is the so-called sunset clauses—or the time when various restrictions on Iran’s nuclear program are lifted. They span from a few years to twenty-five years, although the deal, in multiple places, says Iran can never develop a nuclear bomb. One of the compromises—still being negotiated—toughens that language.

The compromise formula faces two major hurdles: first, the Europeans are asking Washington not only to stick to the deal, brokered by the Obama Administration—they also want a pledge from the Trump Administration to fulfill the U.S. commitments under it. Iran has repeatedly charged that the United States is impeding foreign investment in Iran that was promised under the deal.

In a full-court press, the three European powers that signed the accord—Britain, France, and Germany—are all weighing in with Trump this week to prevent him from abandoning the agreement. The German Chancellor, Angela Merkel, is due here on Friday. The British Prime Minister, Theresa May, is expected to have a telephone conversation with Trump this week as well. “The key is what they get back from the United States,” a European envoy told me. “Trying to talk to the Americans about sanctions relief for Iran has often been a one-way conversation.” But Trump suggested possible movement after his discussion with Macron on Tuesday afternoon. “I think we really had some substantive talks on Iran,” he said. “And we’re looking forward to doing something.”

Macron struck a positive note, too. “It’s not a mystery. We did not have the same starting positions, stances, and neither you nor I have a habit of changing our stances or going with the wind,” the French leader said. “That being said, I can say that we’ve had a very frank discussion.”

The second hurdle is getting Iran to accept documents that supplement the deal, which already covers a hundred and fifty-nine pages. In interviews over the weekend, the Iranian Foreign Minister, Mohammad Javad Zarif, told me that Tehran is in no mood to accommodate further demands, as the U.N. nuclear watchdog agency has repeatedly verified Tehran’s compliance while the United States has violated its obligations.

As part of the expanded compromise, Macron is also using his state visit to urge Trump to keep American forces in Syria—partly to stem Iran’s ability to widen its influence. More than two thousand U.S. troops are deployed in Syria to help defeat around two thousand residual ISIS fighters. The Islamic State holds two pockets of territory in the Euphrates River Valley and along the Syrian border with Iraq. “Together, in the long run, we can find a solution to the Syrian situation,” Macron said at the press conference.

Earlier this month, Trump declared “Mission accomplished” regarding the U.S. deployment in Syria and asked his generals to extricate American troops within four to six months. Trump seemed to have at least listened to Macron’s appeal. “We want to come home,” the President said. “We’ll be coming home. But we want to leave a strong and lasting footprint.”

For a man who has few friends among foreign leaders—and often ignores the advice they offer—Trump may have met a moderating influence in Macron. The President, as he has on other policy issues, may change his mind in the weeks ahead. The central question, of course, is whether he can stomach the idea of any diplomacy with Iran.