Israel is due to hold elections early next year after the prime minister, Benjamin Netanyahu, lost his defence minister and talks broke down in his coalition government on Friday, a source close to the cabinet told the Guardian.

Netanyahu had met the education minister, Naftali Bennett, who wanted the defence ministry post in the rightwing government, but the meeting ended with a decision by cabinet members to hold national polls, which were previously due in November 2019.

During a frantic few hours, ministers rushed to make media statements before the country shut down for the Friday night sabbath.

A source close to Bennett said that at the end of the cabinet discussion it became clear that “there was a need to go to elections as soon as possible with no possibility of continuing the current government”.

Netanyahu’s office said he would attempt to preserve the administration, but that looked unlikely after he lost support from Bennett’s Jewish Home party.

A statement released by the prime minister’s office said “the rumours that a decision to go to elections had been made were incorrect”. It added that Netanyahu had “stressed the importance of making every effort to preserve the rightwing government”.

However, if Bennett’s Jewish Home party leaves the coalition, as it suggested it would, it has the ability to force a new election. Netanyahu’s coalition has 61 seats in the 120-member Knesset so the withdrawal of Jewish Home, which has eight seats, could bring down the government if a no-confidence motion is called.

Another party could be brought into the coalition, but opposition figures have already declared their intention to run against Netanyahu, whose 11 years in office make him Israel’s longest-serving prime minister after founding father David Ben-Gurion. If he can hang on until 17 July he will beat the record.

Government figures would agree on a date on Sunday, the Bennett source added. The minimum election campaigning period is 90 days, meaning polls will not take place until next year. Observers expect the vote to be held between March and May, while Netanyahu might push for a later date.

Bennett had given Netanyahu an ultimatum to give him the defence ministry portfolio after the resignation on Wednesday of Avigdor Lieberman. Lieberman said a ceasefire agreed this week with Hamas militants in Gaza had been “a capitulation to terror”.

In the most intense round of fighting since the war in 2014, militants fired more than 400 rockets and mortar bombs into Israel, which responded with close to 200 strikes in a two-day fight that raised fears of another full-blown conflict.

Violence erupted after Israeli special forces appeared to have been compromised during a covert mission deep inside Gaza, and then engaged in a deadly firefight with gunmen, killing seven and losing a lieutenant colonel, before being airlifted out on a helicopter.

The unofficial ceasefire deal infuriated the more hawkish members of Netanyahu’s cabinet, including Bennett, a hardline Jewish nationalist who rejects any future peace plan that might give Palestinians their own state.

Hamas portrayed the truce as a victory, while a few hundred Israelis living in the country’s south blocked roads and burned tyres this week in protest at the agreement, putting Netanyahu under pressure.

Netanyahu’s Likud party has remained popular in local polls, even as the premier has been linked to several corruption cases, two in which Israeli police have recommended he be indicted for bribery and breach of trust.