He promised total victory for Israel, but standing next to Donald Trump at the White House on Monday, it was Benjamin Netanyahu who looked defeated.

Israel's prime minister was saying all the right things about the peace deal he had just agreed to, but he seemed deflated, his voice hoarse and his energy dimmed, as he praised Trump as the greatest friend Israel has ever had in the White House.

It is a friendship that could cost him his government.

Netanyahu's far-right allies have threatened to leave – and possibly collapse – his government if he makes too many concessions in ending the war. Coalition partners like Bezalel Smotrich and Itamar Ben-Gvir have made little secret of their desire to annex Gaza, drive out Palestinians and re-establish Jewish settlements there.

They – and Netanyahu – have been implacably opposed to any role for the Palestinian Authority in Gaza, and any pathway to a Palestinian State. The deal Netanyahu has now agreed to outlines both, though with heavy caveats.

Trump knows that by pushing the Israeli prime minister into this deal, he is asking him to risk his government. In return, he is dangling the prospect of a historic legacy – a new, more peaceful future for the region, and new ties between Israel and its Arab neighbours.

There were signs, even before Netanyahu left for Washington, that he knew this choice was coming.

Israel's president, Isaac Herzog, told an Israeli radio station that he was considering pardoning Netanyahu in the corruption cases he is currently facing in court.

But the political exit being offered to him in this moment – a regional legacy in return for giving up his government, and possibly his political career – does not seem to have entirely won him over.

His first response to his countrymen today has been to publicly emphasise that he did not, in fact, agree to a Palestinian state.

Absolutely not. It's not even written in the agreement, he said in response to a question on camera. But we did say one thing – that we would forcibly resist a Palestinian state.

Reports in the Israeli media this morning also suggest that Israel's cabinet will not get to vote on the full terms of the deal – but only on the exchange of Israeli hostages for Palestinian prisoners.

Netanyahu is known as a master of political manoeuvres, threading a path between political roadblocks to buy time. He has shifted position through previous rounds of negotiations, and has ridden through previous ceasefire deals, only to back out when a permanent end to the war is up for discussion.

For the first time since the war began, it seems that the consequences of avoiding this deal were worse than the consequences of agreeing to it. If Trump really did force him to choose between his ally in Washington and his allies at home, the future of his political career may depend on the response to this peace effort.