Mr. Gantz’s political stagecraft was put together quickly after the White House extended an invitation to both men last week, while Vice President Mike Pence was visiting Jerusalem. The invitation — the timing of which was seen as Mr. Trump’s latest attempt to distract from the impeachment trial in the Senate — also roiled the political landscape in Israel, where Mr. Netanyahu and Mr. Gantz are locked in a political stalemate.

Mr. Gantz immediately accepted the invitation from the White House. But he reconsidered after seeing Israeli news reports that Mr. Netanyahu was taking credit for inviting him.

The invitation was seen by Mr. Gantz and his advisers as a political trap. Declining to go would hurt him politically in a country where Mr. Trump is viewed overwhelmingly favorably. But accepting would force him to be a bystander as Mr. Netanyahu and Mr. Trump participated in bilateral talks. From Friday morning until late Saturday, Mr. Gantz and his aides debated whether he should attend.

But Mr. Gantz and his team, who have been working for months behind the scenes with Jared Kushner, the president’s son-in-law, and David M. Friedman, the ambassador to Israel, ultimately landed on a face-saving middle ground.

By quietly arranging a one-on-one meeting with Mr. Trump, Mr. Gantz demonstrated out-of-character shrewdness for a man who entered politics only a year ago — and whose appearances without a teleprompter have included enough deer-in-the-headlights interviews that Mr. Netanyahu tried to paint him as “unstable” and more recently mocked him as a stutterer. The meeting also showed how eager the White House is to show off a broad Israeli consensus in favor of its plan.