Israeli Prime Minister Benjamin Netanyahu may have to share power with his chief rival Benny Gantz, who was chosen on Thursday as the new speaker of parliament.

The vote passed 74-18, with many of Gantz’s former allies -- including half of Blue and White -- skipping the vote.

“Democracy has won,” Gantz declared in his first speech as speaker, saying he had taken the unpopular step to deal with the national emergency of a worsening coronavirus crisis.

“These are not regular days and they demand irregular decisions. Therefore as I said, I intend to examine and advance in every way the establishment of a national emergency government,” he said. “We will not compromise on the principles that more than 1 million citizens voted for. Netanyahu knows that well.”

The sudden turnabout by Gantz, who has spent the past year trying to topple Netanyahu in three bitter and inconclusive elections, appeared to give the embattled prime minister a new lease on life as he prepares to go on trial for corruption charges.

FILE - In this Saturday, March 7, 2020 file photo, Blue and White party leader Benny Gantz delivers a statement in Tel Aviv, Israel. (AP Photo/Sebastian Scheiner, File)

FILE - In this Saturday, March 7, 2020 file photo, Blue and White party leader Benny Gantz delivers a statement in Tel Aviv, Israel. (AP Photo/Sebastian Scheiner, File)

It also drew angry criticism from his political partners, who accused him of betrayal, and ripped apart his Blue and White party, an alliance of three anti-Netanyahu factions.

In a series of speeches ahead of the vote, a string of opposition lawmakers who had all previously backed Gantz streamed into the empty parliament chamber one after another to rail against him. Only a few people were allowed in at a time due to restrictions on public gatherings because of the coronavirus.

“This is a dark day,” Nitzan Horowitz, leader of the liberal Meretz party, said in a speech ahead of the vote. “There are no other ways to describe the runaround going on here.”

Israeli media reported that Gantz and Netanyahu were working on forming a broad coalition in which Netanyahu would remain prime minister and Gantz’s party would be granted a number of important portfolios, including defense and justice. In September 2021, Netanyahu would step down and Gantz would become prime minister, the reports said.

CLICK HERE FOR FULL CORONAVIRUS COVERAGE

There was no immediate comment on the reports from Gantz’s party. Netanyahu’s dismissed the reports as “rumors,” though its members backed Gantz in the parliament vote.

The political fireworks come just as the government enacted new restrictions requiring Israelis to stay at home in almost all circumstances, under the threat of fines.

With the country’s coronavirus crisis worsening by the day, Netanyahu has called for an emergency unity government, most recently in a nationally televised speech Wednesday night.

Throughout three bitter election campaigns over the past year, Gantz repeatedly vowed not to join a government led by Netanyahu, citing the prime minister’s upcoming trial on corruption charges.

Prime Minister Benjamin Netanyahu approaches the podium to speak from his Jerusalem office on Saturday, March 14, 2020, saying Israel's restaurants and places of entertainment will be closed to stop the spread of the coronavirus.  (Gali Tibbon/Pool via AP)

Prime Minister Benjamin Netanyahu approaches the podium to speak from his Jerusalem office on Saturday, March 14, 2020, saying Israel's restaurants and places of entertainment will be closed to stop the spread of the coronavirus.  (Gali Tibbon/Pool via AP)

Even in recent weeks, he had rebuffed Netanyahu’s overtures. Members of Blue and White believe Netanyahu is using the health crisis to shield himself from prosecution and have expressed skepticism that Netanyahu would keep his word to relinquish power next year.

But after an appeal for unity by the country’s figurehead president, Gantz agreed on Thursday to resume unity talks.

Netanyahu’s Likud emerged as the largest party in the March 2 election, but along with his smaller religious and nationalist allies, fell short of securing the required majority in parliament.

Gantz was backed by a slim majority in the newly elected Knesset. Although he was given a one-month window to form an alternative government, divisions within that bloc made it all but impossible to establish an alternative government.

CLICK FOR COMPLETE COVERAGE OF THE CORONAVIRUS OUTBREAK

Before Thursday’s about-face, Gantz had pushed for the legislature to continue functioning and led an effort in parliament to approve legislation that would prevent Netanyahu from continuing as prime minister.

The Associated Press contributed to this report.