Trump might lose a crucial ally in the Middle East if Netanyahu is unseated as Israel's prime minister for the first time in a decade

Israel voted Tuesday in elections meant to decide the future of Prime Minister Benjamin Netanyahu, pitting a major ally of US President Donald Trump against a former top Israeli military chief.

If this feels familiar, it is.

Israel most recently had an election just five months ago, after Netanyahu's government dissolved over clashes with his coalition partners. Early elections were called for April 9.

Netanyahu was — and is again — facing Benny Gantz, a 60-year-old who served as the head of the Israel Defense Forces from 2011 to 2015, navigating the country through two incursions on the Gaza Strip.

Gantz leads the centrist Blue and White party, which was formed only this year.

Many voters have voiced support for Gantz, who would undeniably bring change after Netanyahu's four terms and 13 years as prime minister. Netanyahu heads the right-wing Likud party.

He is the longest-serving leader in Israel's history. He has also been embroiled in several corruption scandals and may face criminal charges in the near future.

Both Netanyahu and Gantz won 35 seats in Israel's parliament, far short of the 61 needed for an outright majority. (Israel's parliament, called the Knesset, has 120 seats.)

If a party has no majority, the Israeli president — currently Reuven Rivlin — picks a prime minister based on who is considered most able to form a coalition. In April, Rivlin chose Netanyahu, who then failed to form a coalition government. The consequence was the September election.

Election results put Netanyahu and Gantz neck and neck

As of 2 a.m. Friday in Israel, Gantz's Blue and White party was slightly ahead with 25.93% of the vote.

Netanyahu's Likud party trailed with 25.09% of the vote, with 69% of the votes tallied. Third parties, soon to become strategic allies to the as-of-yet undetermined winner, held smaller yet significant portions of the vote.

Though Israelis are reliving an experience they went through just months ago, voter turnout this election was higher than April's, up to 69.4% from 67.9%.

Read more: Israel has been plunged into political chaos after Netanyahu failed to form a government — and experts say this could be the end of the line for him

If no party secures an outright majority, Rivlin will select his choice. After the president decides, the chosen candidate has 42 days to form a coalition government through negotiation with smaller parties.

If the selected leader can't form a coalition, another candidate will be given a chance.

Gantz on Wednesday night called for a "good and desirable unity government," according to Haaretz, a reference to a possible joint rule between his party and Netanyahu's Likud.

Avigdor Liberman, the leader of the Yisrael Beiteinu party ⁠— a kingmaker in the previous election ⁠— also called on both parties to join together in a "broad liberal unity government."

Netanyahu admitted on Thursday that he would be unable to form the right-wing government he campaigned for and called to lead the country alongside Gantz. But the Blue and White leader swiftly rejected the proposal and instead called on Netanyahu's religious allies to dump their coalition agreements with Likud.

"I intend to form a broad and liberal unity government under my leadership," Gantz said at a news conference Thursday, urging Likud to replace Netanyahu as it's head.

"If Netanyahu moves aside, we'll have a unity government."

Experts say it's likely Netanyahu will be unseated — and Trump will lose a strategic Middle East ally

Exit polls suggest that Netanyahu's role as Israel's strongman may soon be coming to an end.

Yohanan Plesner, the president of the Israel Democracy Institute, said in a press call on Tuesday that exit polls indicated a "quite dramatic outcome."

"For the first time after a decade, there is a very high likelihood that Netanyahu is no longer going to be the prime minister of the State of Israel," he said.

While it may be up to Rivlin to say which candidate will be tasked with forming a coalition, Plesner said Netanyahu's chances appeared to be "blocked, because Gantz has more potential coalition partners."

Plesner added that Likud might decide to unseat Netanyahu as party leader, which could help its chances of forming a unity government.

"We might enter a period of days and perhaps weeks when it is unclear who is going to be the prime minister," he said.

Netanyahu is a strategic ally to US President Donald Trump and has grown closer to him since his election in 2016.

Under the Trump administration, the US has made several policy decisions favorable to Israel, including recognizing Jerusalem as Israel's capital and moving its embassy there, withdrawing from the nuclear deal it signed with Israel's nemesis Iran, and calling for the recognition of Israel's annexation of the Golan Heights.

But Plesner said Trump's friendliness did less to boost Netanyahu in this election, because voters were used to it and any boost "was already factored in."