While Iranian Foreign Minister Mohammad Javad Zarif was making his way to France for a surprise visit at the G7 summit on Sunday, Israeli Prime Minister Benjamin Netanyahu and his team scrambled to make sure President Trump wouldn’t meet with him, according to U.S. and Israeli officials.

Netanyahu frantically tried to get President Trump on the phone — who was in back-to-back meetings and couldn’t take the call — while his office contacted multiple senior Trump administration officials, trying to connect the two leaders.

Between the lines: The Israelis were worried that Trump — who loves making a deal and relishes the drama of an unconventional meeting (think Kim Jong-un) — would let French President Emmanuel Macron talk him into holding an unscheduled meeting with Zarif.

The Israelis feared that a Zarif meeting could have made Trump more likely to agree to a meeting with Iranian President Hassan Rouhani — leading to a showy summit and a long, open-ended diplomatic process that would take the pressure off of the Iranian regime.

Trump has made it clear he's willing to meet with the Iranians without preconditions, but his administration recently sanctioned Zarif and U.S. officials said a meeting with him would have been highly inappropriate.

Macron threw a curveball at the Americans — irritating some senior Trump administration officials — by inviting Zarif to Biarritz. And Trump, who usually sees little downside in meeting with foreign adversaries, appeared open enough to the idea that Israeli officials worried he might upend his carefully-planned schedule to meet with Zarif.

Trump administration officials said they viewed a Zarif meeting as ill-advised, both for policy reasons but also because Zarif is effectively a spokesperson with no real authority. They didn’t want to upend protocol and elevate him by seating him across the table from the president of the United States.

Why it matters: Netanyahu’s urgent attempts to get Trump on the phone showed the deep nervousness in Israel about possible renewed talks between the U.S. and Iran.

Netanyahu saw Trump’s withdrawal from the Iran nuclear deal as a signature foreign policy achievement — and one that remains essential to Israel’s security. Any loosening of Trump's "maximum pressure" campaign on Iran could create tension with America’s closest ally in the Middle East.

The White House and Netanyahu's office declined to comment.

Behind the scenes: On Friday morning, Macron met with Zarif in Paris. On Saturday evening, the leaders of the G7 discussed the Iranian issue over dinner, and Macron briefed the other leaders, including Trump, on his talks with Zarif.

Macron invited Zarif to Biarritz for more meetings on the sidelines of the G7 summit.

As Macron later explained at a press conference, his ultimate goal is to broker a meeting between Trump and Rouhani.

On Sunday, Netanyahu got word about Zarif’s planned drop-in at the G7 and was worried Trump or other senior U.S. officials might meet with the Iranian foreign minister, according to U.S. and Israeli officials. Netanyahu asked to schedule a phone call with Trump right away.

The big picture: These events unfolded while a serious escalation took place at Israel’s northern border with Syria and Lebanon. Late Saturday night, Israel launched airstrikes into Syria, targeting an Iranian Revolutionary Guard Corps special unit that Israeli officials said was plotting drone attacks against Israeli targets.

A separate drone attack reportedly took place in Beirut on Sunday near Hezbollah headquarters. The Israeli government has remained tight-lipped about this attack.

Israeli officials said Netanyahu was dealing with the Iranian issue all day Sunday, and felt an urgent need to speak directly to Trump. U.S. officials described a fast-moving situation in which the Israelis were calling multiple members of the Trump administration.

U.S. officials could not say how close Trump was to agreeing to a meeting with Zarif. Macron said at his press conference with Trump on Monday that he wanted to arrange a meeting between Zarif and a U.S. cabinet secretary.

U.S. Secretary of State Mike Pompeo wasn’t present at the G7 summit, but Treasury Secretary Steven Mnuchin was there with Trump. Trump said on Monday that he told Macron he didn’t think the timing was right for a meeting with Zarif at the G7, but that he was open to meeting Rouhani another time.

Netanyahu ultimately spoke with Vice President Mike Pence and Pompeo.

What we’re hearing: U.S. officials said Trump decided not to meet Zarif regardless of Netanyahu’s messages, and they told the Israelis of Trump’s decision on Sunday. They said when Trump finished his G7 meetings that day, administration officials asked the Israelis if they wanted to connect the call with Netanyahu, but there was no need because Trump had already decided not to hold the meeting.