Crucially, it also means Mr. Gantz will be able to fly back to Israel in time to oversee a key proceeding Tuesday regarding Mr. Netanyahu’s attempt to obtain parliamentary immunity from prosecution on serious corruption charges. Lawmakers are expected to reject the request, with Mr. Netanyahu’s party, Likud, vowing to boycott Tuesday’s debate in protest, but if Mr. Gantz were in Washington, that likely would have been delayed.

In effect, Mr. Gantz, who had seemingly been cornered by the White House invitation, found an unseen exit, allowing him to avoid aiding Mr. Netanyahu without offending Israel’s closest and most powerful ally.

“Following this important meeting, I will return to Israel in order to lead the debates regarding Netanyahu’s immunity from up close,” Mr. Gantz said in Hebrew, in an announcement that was carried live by Israeli television.

“These are not regular days for the state of Israel,” he added.

A meeting of the American president and Israeli prime minister with Mr. Gantz, who is merely a member of Parliament, could have embarrassed him in the eyes of Israelis. Mr. Netanyahu could have put him on the spot before the cameras by cajoling Mr. Gantz to join a unity government after the March 2 election. It would have meant communicating in English, in which Mr. Netanyahu is peerless among Israeli politicians and Mr. Gantz is much less comfortable.

Mr. Gantz, who is tacking to the right in his campaign this time, was full of praise for Mr. Trump, calling him “a true friend of the state of Israel, the citizens of Israel and the Jews of the United States,” and saying his leadership “has made the alliance between us deeper, stronger and more powerful than ever.”