Israel appears to be on the brink of a new political era after an awkward coalition of parties from across the political spectrum announced it had formed a government.

Taking negotiations up to the wire, opposition leader Yair Lapid informed the country’s president late on Wednesday that he had struck a power-sharing deal with a broad grouping of right, centre and centre-left parties.

The formation of a ‘change government’ should, in theory, bring to an end 12 years in power for prime minister Mr Netanyahu and two years of political stagnation with four inconclusive elections but there are still hurdles to jump.

Under the deal, Mr Lapid, a former journalist turned centrist politician, has agreed that the right-wing leader of the much smaller Yamina party, Naftali Bennett, will serve as PM for the first two years before handing the leadership to Mr Lapid.

The coalition’s only real unity comes in wanting to remove Mr Netanyahu. And it’s fragility was proven in the final hours before a deal was reached.

Members of Mr Bennett’s Yamina party have been under huge pressure from their supporters not to join a government with the centre-left. The party’s deputy, Ayelet Shaked, had her security increased in recent days because of death threats.

Ms Shaked has been attempting to secure concessions from Mr Lapid including obtaining a seat on the committee which appoints judges.

More on Benjamin Netanyahu

Elsewhere in the coalition, the Arab-Israeli Ra’am party made last minute demands on cancelling a law that makes it easier to conduct demolitions in Arab towns and villages in Israel. The demands were rejected by the right-wing faction.

Mr Netanyahu has been written off many times before only to find ways of holding on to power.

Just two weeks ago, Mr Netanyahu was casting himself, again, as the defender of the nation as another cycle of violence with Palestinians in Gaza unfolded.

But the complexities of Israeli politics were always lurking behind him.

Still, his supporters are not writing him off yet.

Danny Danon was Mr Netanyahu’s ambassador to the UN until last year.

He said: “I will be cautious and I will not start to sum up his political career. We have seen in the past that he pulls magic out of his sleeve when people started to sum up his career. But anyone will agree with me that he is one of the greatest leaders in Israel’s history.”

He continued: “I think we have to be patient. We have to wait until the last minute, until the last vote will be counted in the parliament. Only then when the new government will be sworn, we can trust they can still speak about a new era in our politics.”

The vote of confidence in the new government will take place next week, probably on Wednesday. That gives Mr Netanyahu and his allies a narrow window to try to lure members of the new coalition away, chipping away at the majority.

One source close to the negotiations told Sky News: “We’re in for days of hell.”

Follow the Daily podcast on Apple Podcasts, Google Podcasts, Spotify, Spreaker

Assuming it lasts, the coalition is unlikely to be able to push through any of its individual party’s more radical policies.

But the process of running the country in its most basic form can resume and it will bring to an end a prolonged period of political deadlock.