Benjamin Netanyahu has won a reprieve from the threat of early elections in Israel after a senior member of his cabinet announced he would not resign and break up the coalition government.

Naftali Bennett, the hardliner education minister, was widely expected to quit during a press conference on Monday morning but instead said in a surprise announcement that his Jewish Home party would give the prime minister another chance.

Bennett, a security hawk, had considered following Netanyahu’s defence minister, Avigdor Lieberman, who left the Israeli government to protest against Netanyahu’s decision to agree to a truce with the rulers of Gaza, Hamas.

The Tuesday ceasefire followed the most intense round of fighting since the war in 2014, as militants and Israeli forces battled each other with rockets and airstrikes.

Bennett had threatened to bring down the government if he was not appointed defence minister, a portfolio Netanyahu gave to himself on Sunday. If the education minister had left, he would have stripped the prime minister of his parliamentary majority and triggered early polls.

Netanyahu, who would become Israel’s longest-serving prime minister if he remains in power after July, had said in a last-minute appeal on Sunday that it would be “irresponsible” to dissolve the government and call early elections during the current period of volatility in Gaza.

Bennett, who has been fiercely critical of Netanyahu but whose party’s support in parliament has prevented the leader from losing a one-seat majority, said he would delay during this tense time for the country.

“If the prime minister is serious in his intentions, and I want to believe his words from last night, I am saying here to the prime minister we are removing at this moment all of our political demands and will help you in the huge mission of making Israel win again,” Bennett said in a statement that was broadcast live.

He acknowledged his gambit to take the defence ministry had failed. “I know I’ll pay a political price – not the end of the world, you win some, you lose some,” Bennett said.

“It’s better that the prime minister beats me in a political battle than [the Hamas leader, Ismail] Haniya beats Israel.”

Israeli governments serve four-year terms and Netanyahu must call elections by November 2019. However, the country’s political system often produces unstable coalition cabinets meaning polls would normally be held before full terms have been served, and the prime minister could still face an early challenge.

A deadly Israeli military crackdown on a protest movement in Gaza, followed by bouts of violence with armed Palestinian groups this year, have led to calls from Israeli rightwingers for heavier action, even as senior army figures have warned against a war. Israel has fought three conflicts with Hamas during the past decade.