WASHINGTON — In the midst of his campaign, President Trump vowed to bring peace to the Middle East by playing it down the middle between Israel and the Palestinians. “Let me be sort of a neutral guy,” he said. Two years later, any hopes of being the neutral guy are long gone.

In a meeting at the White House on Monday, Mr. Trump and Prime Minister Benjamin Netanyahu of Israel put on display perhaps the closest relationship between leaders of their two countries in the seven decades since Israel declared independence. As for the Palestinians, they are no longer on speaking terms with the president, who is busy cutting their aid.

Few if any doubted that Mr. Trump came into office more supportive of Israel than the Palestinians and he trumpeted his pro-Israeli credentials, but any semblance of straddling the line between warring camps has vanished and the notion that he could bring them together appears more distant than ever. Mr. Trump and Mr. Netanyahu lavished praise on each other on Monday, and the president said he might visit Jerusalem in May to preside over the politically potent transfer of the American Embassy to the disputed holy city.

Mr. Trump insisted that he still had “a good chance” of forging peace and expressed optimism that the Palestinians were ready to return to discussions. “The Palestinians, I think, are wanting to come back to the table very badly,” he said, despite evidence to the contrary. Then he acknowledged what would happen if he is wrong. “If they don’t, you don’t have peace.”