Jerusalem — For a president mired in scandal at home, Donald Trump’s first foreign tour has proved a welcome distraction. His speech at Israel’s national museum on Tuesday was punctuated frequently with lusty applause from a crowd stocked with longtime supporters. “Maybe he’ll just decide to stay overseas for good,” joked one U.S. Embassy staffer at the event.

The warm welcome was not a foregone conclusion. Trump’s Israeli supporters spent the past four months with a constant case of whiplash. On the campaign trail, the president often promised to move the U.S. Embassy from Tel Aviv to Jerusalem. Press Secretary Sean Spicer also declined to condemn a spurt of new Israeli settlement construction days after the inauguration.

The pro-settler right was jubilant — but the euphoria wouldn’t last. In his first meeting with Prime Minister Benjamin Netanyahu, Trump asked the Israeli leader to “hold back” on further building in the occupied territories. Then in the weeks that followed, administration officials took the embassy move off the table, and Trump spoke with optimism about striking “the ultimate deal” between Israel and the Palestinians.

Joy quickly turned to despair, and Israeli hawks started to attack Netanyahu for allegedly blowing Israel’s best opportunity to change America’s long-standing support for Palestinian statehood.

“I don’t believe that Trump came with this huge vision of a two-state solution,” Naftali Bennett, the head of the pro-settler Jewish Home party, told Foreign Policy. “I think we’ve been inviting these pressures.”

But Netanyahu does have a strategy to deal with Trump, and it is slowly starting to bear fruit. Notably, Trump declined to pressure Israel in any way in his national museum speech, which focused almost entirely on Iran and global terrorism. Netanyahu is playing a long game, according to advisors and diplomats — and already the Trump administration’s policies have shifted in a direction beneficial to the Israeli prime minister.

Until January, Netanyahu had only worked with Democratic presidents — and his relationships with both Bill Clinton and Barack Obama were turbulent, to say the least. A furious Clinton once emerged from a meeting with Bibi and asked: “Who’s the fucking superpower here?” Netanyahu now has an asset he has never enjoyed during his time in power — a solicitous ear in the White House and a Republican-controlled Congress.

The Israeli prime minister, however, knows that Trump is mercurial. So he has laid on the charm for the president’s first visit to Israel, ordering his entire cabinet to attend the welcome ceremony on Monday. He also looked mortified when a Likud backbencher (also, reportedly, a former pimp) grabbed Trump for a selfie. Later that evening, he invited the Trumps for dinner at the official residence, where he presented them with a 19th-century Bible. Trump called the meal “unforgettable.”

The Palestinians also thought they had made a good impression with Trump. Trump warmly received Mahmoud Abbas at the White House earlier this month; the rulers of Egypt and Jordan, two close allies, also made the case for Palestinian statehood during their own Oval Office chats.

However, Trump has so far dashed their hopes that his administration plans to increase pressure on Netanyahu to issue a settlement freeze and publicly endorse the two-state solution. In fact, the Trump administration appears to be moving in the opposite direction: Trump made six public statements during his 28 hours in the Holy Land — but not once did he utter the words “two-state solution.” The Israelis took note.

As Mohammad Shtayyeh, a member of Fatah’s central committee, admitted, “Trump is an unpredictable man.” There has been little serious talk of a settlement freeze, a step that would infuriate Netanyahu’s far-right coalition. Nor has Trump clarified his views after declaring, at his first meeting with Netanyahu, that he was “looking at two-state and one-state.”

“It’s fine with us, from our point of view,” a Netanyahu aide said before the president’s speech. “Since he came into office, I don’t think two states has been the focus anymore … and the prime minister has always said it will be a state-minus.”

Still, Trump stressed his “personal commitment” to ending the conflict. Even if there is no peace, there will be a process: While Trump does not plan to start with a splashy summit, he has urged both sides to take modest steps toward building trust. In his meeting with Abbas, he urged the Palestinian president to suspend his government’s welfare payments to the families of imprisoned Palestinian militants.

Trump’s aides have also asked Israel to bolster the Palestinian economy. The security cabinet on Sunday approved a few modest steps to that effect: The Israeli army will issue more building permits in “Area C,” the roughly two-thirds of the West Bank under full Israeli control, and the Allenby Bridge connecting the West Bank with Jordan will be open 24 hours a day, making it slightly easier for Palestinians to travel abroad.

The Gulf states, in turn, have dangled their own carrots in front of Israel in exchange for renewed peace talks with the Palestinians, like telecommunications links and overflight rights for El Al, Israel’s national airline.

All of this is music to Netanyahu’s ears. The prime minister has spent the past decade promoting a theory of “economic peace,” where better living conditions in the occupied territories would defuse Palestinian animosity toward Israel. The strategy has been a failure on both counts: The West Bank economy is stagnant, with official unemployment at 16 percent, and the conflict boils on. Critics say Netanyahu has adopted a stalling tactic, meant to avoid the serious work of a diplomatic settlement.

In recent years, Netanyahu has also embraced the “outside-in” approach to the conflict. Peace between Israel and its Arab neighbors, he argues, would also bring about a deal closer to home. The Palestinians accept this idea in public, though Abbas reminded Trump on Tuesday that any regional deal still requires a bilateral agreement.

But in private, such talk worries them. The Arab autocrats who welcomed Trump in Riyadh have their own strategic interest in closer ties with Israel, which would be a valuable ally in the regional cold war against Iran. “The Arab states have let us down before,” said one longtime Palestinian diplomat. “I don’t think they would hesitate to do it again.”

Trump’s top officials also do not appear emotionally or intellectually invested in this issue. Obama and George W. Bush both had secretaries of state who were deeply committed to bringing peace in the Holy Land. Trump’s chief diplomat, Rex Tillerson, has evinced little interest in the conflict. He mistakenly told reporters on Monday that Tel Aviv, a secular city founded in 1909, was the “home of Judaism.” (Trump himself seemed a bit flummoxed by the region’s geography, telling the Israeli president that “we just got back from the Middle East.”)

Instead, the Trump administration’s efforts are being run by a small group of longtime confidantes. The U.S. ambassador to Israel, David Friedman, used to run a charity that donated millions of dollars to Beit El, one of the West Bank’s more ideological settlements. But Friedman only arrived this week, and his role may prove to be largely symbolic — one person who briefed Friedman said he had to explain the difference between Fatah and the PLO.

The real players will be Trump’s special envoy, Jason Greenblatt, and his son-in-law, Jared Kushner. Greenblatt went on a listening tour this spring and won praise for meeting a wide range of Israelis and Palestinians. He has done no interviews, though, and his personal views are a mystery. Kushner has been basically mute — on this issue and everything else in his expansive portfolio, which includes relations with China and solving the opioid crisis in the United States.

But even if Trump is deeply committed to cutting a deal, he faces an uphill slog. The Israeli government is the most conservative in decades. The schism between Fatah and Hamas has only deepened: Abbas recently cut off fuel subsidies and shipments of medicine to Gaza, steps that have raised fears of a fourth war in the blockaded enclave. Trump himself, facing investigation by a special counsel and historically low poll numbers, may not have much interest in the maps and memos that absorbed his predecessors.

If Trump loses interest, Netanyahu’s strategy toward the new president may be vindicated. At their dinner on Monday, Netanyahu served Trump’s favorite fare: steak and chocolate cake. The only lighter option was a salmon dish. The menu dubbed it, fittingly for a fish that swims upstream, “The Path to Peace.”