Benny Gantz is forming a unity government with Israeli Prime Minister Benjamin Netanyahu, after spending a year vowing to never join a government led by the indicted Israeli leader, reports from Israeli media say.

The move came after Netanyahu urged Gantz to form an "emergency" unity government amid the coronavirus pandemic.

Gantz will take over as the speaker of Israel's parliament while Netanyahu will hold the prime ministership through 2021, reports say.

Visit Business Insider's homepage for more stories.

Benny Gantz has agreed to form a unity government with Israeli Prime Minister Benjamin Netanyahu, the New York Times and Israeli media outlets reported Thursday.

The agreement between the two political rivals marked a surprising twist in an already dramatic year for Israel, in which three elections were held and Netanyahu was indicted on corruption charges.

It means Netanyahu has secured a new term as prime minister, and Israel's political deadlock is seemingly over. Meanwhile, Gantz will reportedly take over as the speaker of the Knesset, Israel's parliament. The move led to the immediate collapse of Gantz's centrist Blue and White party.

And after spending a year vowing to never join a government led by the indicted Netanyahu, Gantz, a former Israeli army chief, has sent shockwaves through the Israeli political world by going in the opposite direction.

From the Knesset podium Thursday, Gantz vowed to use his role to protect the country's civil rights and democratic protections.

"Make no mistake, I will not compromise on principles for which over a million citizens voted," he said.

There are conflicting reports on the role Gantz will assume moving forward, and the precise details of the unity deal remained unclear as of Thursday morning.

With the collapse of Blue and White, Gantz has formed a new party, called Israel Resilience (Blue and White was made up of several factions). According to Haaretz, the new party will receive a number of ministerial posts as part of the Netanyahu-led government. The Times of Israel reported that Gantz will initially serve as the country's foreign minister and take over as prime minister in 2021 after 18 months.

Analysts have portrayed the development as Gantz essentially capitulating to Netanyahu.

"Gantz has surrendered to Bibi. This is shocking," Ilan Goldenberg, director of the Middle East Security Program at the Center for a New American Security, tweeted on Thursday.

Though the unity deal came as a surprise to many, it could also mean less political uncertainty for Israel amid the coronavirus pandemic. The outbreak had led Netanyahu in recent days to urge Gantz to form an "emergency" unity government.

Both Gantz and Netanyahu failed to secure a majority in the most recent election on March 2.

But after being endorsed by 61 lawmakers in Israel's 120-member parliament, Gantz on March 16 was given the opportunity to form a government. Gantz pledged to "form a national unity government, as broad as possible, within days," even as his allies pushed for Netanyahu to be replaced.