Benjamin Netanyahu hinted at a possible rotating premiership deal with his chief rival Benny Gantz

After failing to secure a clear election victory twice in six months, Israel's longest-serving prime minister now seems to be calculating that he can stay in power only by sharing it.

Following Tuesday's deadlocked parliamentary election, a weakened Benjamin Netanyahu offered a national unity government on Thursday to his chief rival Benny Gantz - a former general who has emerged this year as a fresh face to take on Netanyahu.

But Gantz's party rebuffed the veteran leader who has dominated Israeli politics, alone and virtually unchallenged, for the last decade.

Gantz did not even mention Netanyahu by name and left it to his junior party leaders to echo his campaign pledge not to enter an alliance with the prime minister, who faces corruption allegations which he denies.

Most people expected the experienced Netanyahu to cobble together a ruling coalition, so his failure to do so - twice - looks weak, in a country that puts a high premium on strength.

Is This His The End Of Netanyahu?

It is too soon to proclaim the end of the Netanyahu era, but it may be the beginning of the end.

For a decade Netanyahu - who turns 70 in a month - dominated Israel's airwaves, news cycles and social media platforms and was the only Israeli prime minister that many world leaders had ever dealt with.

But the man known to his adoring Likud Party supporters as "the magician" has wriggled out of tight spots before.

Why Is Netanyahu Caring About Sharing?

Netanyahu hinted at a possible rotating premiership deal with Gantz, citing the 1980s deal between former Prime Minister Shimon Peres, a left-wing leader, and Netanyahu's conservative Likud predecessor, Yitzhak Shamir. The pair rotated the top office between 1984 and 1988.

Shamir, who died in 2012, was a security hawk who entered his awkward coalition arrangement with Peres after his Likud predecessor, Menachem Begin, stepped down amid public division over Israel's 1982 invasion of Lebanon.

Sharing power would allow Netanyahu to secure a record fifth premiership, ensuring his political survival and allowing him to say he has a public mandate to fight off criminal charges that may be levelled against him in the near future.

Who Won The Election?

With Israeli media reporting 99 percent of votes counted in Tuesday's election, Netanyahu's right-wing Likud has a provisional 31 seats in the 120-member parliament.

That may change as more votes are tallied, but as things stand Likud is two seats behind Gantz's centrist Blue and White Party. Neither has a clear path to power without relying on others, but Gantz appears to be in a stronger position.

Why Is It Taking So Long To Form A New Government?

No single Israeli party has ever won an outright majority in the legislature, a reflection of the country's political, religious and ethnic divisions. That is not going to change in a year of unprecedented electoral instability which has already seen two elections - on April 9 and September 17.

Netanyahu leads a cluster of right-wing and ultra-Orthodox parties which currently stands at 55 seats.

A Gantz-led centre-left bloc would potentially have 57 seats, and Gantz said he envisioned a "liberal" coalition, Israeli political shorthand for a secular one that would exclude Netanyahu's long-time ultra-Orthodox allies.

Are There Any Other Key Players?

One wildcard is Avigdor Lieberman, a far-right immigrant from the former Soviet Union who lives in an Israeli settlement in the occupied West Bank. Lieberman is fiercely secular and ultra-hawkish on issues relating to security and the Israeli-Palestinian conflict.

Leiberman took a huge gamble by refusing to join a Netanyahu coalition government on a point of principle after April's election, forcing a second election. He reaped the reward by boosting his party's number of seats.

But after Netanyahu reached out to Gantz on Thursday - potentially squeezing Lieberman out - Lieberman reacted angrily, saying Netanyahu was "simply an opportunist" intent on outmanoeuvring his rivals to "prepare public opinion for a third round of elections."

Lieberman may end up as kingmaker. He may do a deal to prop up Netanyahu. He may be squeezed out altogether.

What About Corruption Allegations Against Netanyahu?

After a long-running police investigation, Israel's attorney-general has announced his intention to indict Netanyahu in three corruption cases.

He is expected to decide whether to lay formal charges by the end of 2019. But there is a pre-trial hearing in October, during which Netanyahu can argue against indictment. He denies wrongdoing and says he is the victim of a witch-hunt.

Netanyahu's allies signalled support for granting him parliamentary immunity. But that scenario is likely to cause a public outcry, and now appears remote.

If Netanyahu does remain as prime minister - or a rotating one - the law says he does not have to step down even if he is formally charged. But if he is forced into a unity government with Gantz he could face far more political and public pressure to leave office.

Some analysts have suggested a deal may be broached in which Netanyahu steps down from public office for good in return for reduced charges.

What Happens After The Final Votes Are In?

Israel's president will consult with all party leaders about their preference for prime minister, and will then choose the one he thinks has the best chance of putting together a coalition.

The nominee, who does not necessarily have to be the head of the largest party, has up to 42 days to form a government. If he or she fails - as Netanyahu did following April's election - the president can ask another politician to try.

How Long Until A Government Is In Place?

It could take weeks. Past coalition negotiations have often dragged on until the very last minute. Whoever is asked to form the next government will have to accommodate numerous parties. It could prove quicker if Netanyahu and Gantz choose to join forces, with or without the help of Lieberman.

What About Trump's Peace Plan?

Netanyahu has said he expects US President Donald Trump to release his long-delayed plan for Israeli-Palestinian peace soon after the election.

But Trump may want to wait and see what government is formed before unveiling the plan. Netanyahu would certainly have a hard time getting far-right allies to sign on to any peace plan involving concessions to the Palestinians.

Netanyahu had announced his intention to annex the Jordan Valley in the occupied West Bank, where the Palestinians seek statehood. But without a clear majority of right-wing backers such a move appears unlikely.

A cabinet with Gantz in it would likely be more open to negotiations with the Palestinians.