Jerusalem(CNN) In a move that appears to signal the end to Israel's year-long political deadlock, Benny Gantz has been elected Speaker of the Israeli Parliament and declared he wishes to form an emergency national government.

The surprise move suggests Gantz will serve in a government led by the indicted Prime Minister Benjamin Netanyahu -- which would break one of his key campaign promises. In the end, the coronavirus seems to have done what the country's politicians could not do by themselves: bring them together at a critical time to move the country forward. The longest-serving leader in Israel's history now appears set to continue in his role in the near future, with the backing of his main rival.

Gantz had already been chosen to form a new government with the backing of the majority of the Knesset. His decision to become Speaker instead drew accusations of betrayal from his former supporters, and triggered the almost immediate break-up of the Blue and White party, formed a year ago and comprised of Gantz's Israel Resilience party and two smaller parties. The former IDF Chief of Staff now looks set to take Israel Resilience into Netanyahu's right-wing bloc to form a comfortable majority in the Knesset, Israel's parliament.

"I will do the right thing at this time of emergency," Gantz said in his first address from the Speaker's chair, striking a conciliatory tone in trying to explain his decision. "The people of Israel are justifiably looking to us and expecting us to keep supporting the sacred battle against the coronavirus and its effect. And no less justifiably, they are demanding that we safeguard our democracy, our national decorum and our unity."

The decision to pursue a national emergency government is a clear victory for Netanyahu, who is set to remain Prime Minister, despite being indicted on charges of bribery, fraud and breach of trust and having failed to secure a governing majority after elections in April and September. He appeared to fall short once again after elections earlier this month, but Gantz's support should be more than Netanyahu needs to secure his own position.

Even so, a unity government built around Gantz's faction and Netanyahu's Likud party is not guaranteed yet, as both groups need to come to an agreement. Netanyahu had not issued any statements about Gantz's decision as of late Thursday night, while his Likud party issued a short statement only saying, "Reports on the details of negotiations are purely rumors."

For years, Netanyahu has enjoyed the aura of a political magician among his supporters, winning election after election and seeing off a steady stream of rivals, both from within his own party and from the outside. But his magic appeared to have finally run out when he failed to secure a clear governing majority in three consecutive elections over an eleven-month period.

So this may go down as his greatest trick yet, turning his main political rival -- who swore not to serve under an indicted Prime Minister -- into exactly the support he needed to remain Israel's leader. Netanyahu now looks set to get his fifth term as Prime Minister.

Gantz, who had campaigned on a slogan of "Israel before everything," said his decision was driven by the national interests in a time of emergency. "Every crisis includes an element of opportunity. And even in the throes of this crisis, as we fight the pandemic, we will use the opportunity to bolster our democracy and reinforce it," he said.

A frequent critic of Netanyahu's attacks on the judiciary, the media, and the Arab citizens of Israel, Gantz suggested his participation in government could bring the Prime Minister to heel.

"We will get [Israel's] system of checks-and-balances back on track, we will put an end to the unrestrained attacks on our democracy on the part of irresponsible government ministers, we will dispose of schemes to harm the judicial branch, and we will heal the rifts tearing at our social fabric."

There have been many unprecedented firsts over the course of the last year in Israeli politics: the first failure to form a government after an election, the first sitting Prime Minister indicted, the first "repeat" election, and more. But this may be the most extraordinary. A political leader who has won enough support to get first shot at forming a new government instead gets himself installed as Speaker of the Knesset, paving the way for his main rival to remain Prime Minister.

"These are unusual times and they call for unusual decision," Gantz said.

Earlier on Thursday, the expectation was that Blue and White would secure the election of one of their backbenchers as Speaker, giving them control of the legislature and allowing them to form committees and pass legislation.

But at the last moment, Gantz nixed the original candidate, putting himself forward for the Speaker's chair. It was an attempt to keep alive negotiations for a unity government between himself and Netanyahu, who had threatened to call off the talks if the party stuck with its original choice. The reversal infuriated members of Gantz's own party, some of whom then boycotted the vote for Speaker, which Gantz won with the support of Netanyahu and the right-wing.

One of his erstwhile closest allies in Blue and White, Yair Lapid, ripped Gantz's decision as a betrayal of the party's voters, saying, "Their votes were stolen and given as a gift to Netanyahu."

"Benny Gantz decided today to break apart Blue and White and crawl into Netanyahu's government. It's a disappointing decision," Lapid said, speaking in Tel Aviv Thursday night. "What's being formed today isn't a unity government and not an emergency government. It's another Netanyahu government."

Those more sympathetic to Gantz believe he had few other options. While he did have the support of 61 members of Knesset after the elections earlier this month, which is a majority in Israel's 120-member parliament and enough to form committees and pass legislation, it was not enough to form a government. The political distance between the parties inside his bloc was just too great.

Gantz's 61 seats included 15 from the Joint List of Arab parties, which said it would support a Gantz-led government from the outside. That could have led to a minority government, but it was never an easy option -- not least because two members of Gantz's own party were vehemently opposed to a government that relied on the Arab vote, making an already difficult option virtually impossible.

In the past, Blue and White had also hoped that indictments against Netanyahu would either fracture Likud or break up the bloc of right-wing and religious parties. But it never happened, and their loyalty to Netanyahu was perhaps never in serious doubt.

So Gantz likely calculated he could either fight a fourth election in the midst of an international pandemic, or join Netanyahu in government. In choosing the latter, Gantz fractured his own party.

His decision was welcomed by Israel's right-wing. Defense Minister Naftali Bennett tweeted his support, writing, "I congratulate Benny Gantz on the courageous step of entering a unity government led by Netanyahu. This is the right thing for Israel in an emergency."

The statements from the right-wing were an about-face from the heaps of criticism poured on the then-opposition leader during the election campaign. Now the criticism was coming from the center-left, which had thrown their full support behind Gantz until Thursday afternoon.

Tamar Zandberg, a member of the left-wing Meretz party, said on Twitter, "Benny - you could have chosen between a government led by you or a disgrace. You chose a government led by Netanyahu and you will be disgraced."