TEL AVIV—Israeli right-wing politician Naftali Bennett said Sunday he plans to join a rival in a coalition opposed to Prime Minister Benjamin Netanyahu, paving the way for the formation of a government that would end the incumbent’s more than decadelong grip on power.

“It is my intention to act with all my power to establish a national unity government with my friend Yair Lapid so that we can save this country from this spiral and get it back on path,” Mr. Bennett said. “We can stop this insanity and take responsibility.”

Mr. Bennett’s Yamina party is expected to be the main partner to Yair Lapid’s centrist Yesh Atid party in the coalition. Mr. Lapid received the mandate to form a government earlier this month after Mr. Netanyahu first failed to do so following an inconclusive March election, the country’s fourth since 2019.

Efforts to form a ruling coalition could still collapse as many parties from across the political spectrum try and agree on the government’s agenda and cabinet portfolios. It would also likely need the outside support of Israel’s Arab parties.

Mr. Lapid has until June 2 to inform the president of his government formation plan. If he fails to do so, President Reuven Rivlin would then hand responsibility for selecting a new prime minister back to Israel’s parliament before a new election is called.

A spokesman for Mr. Lapid said negotiating teams from his party and Mr. Bennett’s party were meeting Sunday evening to work toward forming a government.

Mr. Netanyahu, in a televised statement immediately after Mr. Bennett spoke, called on right-wing lawmakers to vote against the Bennett-Lapid government. “Don’t establish a left-wing government. Such a government will be a danger to the security of Israel and to the future of the country,” Mr. Netanyahu said.

Mr. Netanyahu’s rivals say he is focused more on staying in office to help shield himself from allegations of corruption, which he denies, than giving priority to the needs of the country.

“The option of a right-wing government headed by Netanyahu simply doesn’t exist,” Mr. Bennett said Sunday.

Messrs. Bennett and Lapid are expected to take turns at leading the government, with Mr. Bennett serving first as prime minister for two years, the officials said.

Benjamin Netanyahu’s Likud party won the most seats in the last election, but the prime minister was unable to form a ruling coalition so he could remain in control.

Benjamin Netanyahu’s Likud party won the most seats in the last election, but the prime minister was unable to form a ruling coalition so he could remain in control.

Photo: ammar awad/Reuters

Mr. Bennett controls seven seats in the Knesset, or parliament, to Mr. Lapid’s 17, but right-wing Jewish Israelis who previously supported Mr. Netanyahu’s governments may find him a more acceptable candidate as prime minister.

Any new government faces a range of economic and security challenges.

It will have to take steps to boost economic growth while keeping a check on the coronavirus pandemic. Israel is opening up again, after several lockdowns last year, following one of the world’s fastest Covid-19 inoculation campaigns.

Meanwhile, a cease-fire between Israel and Gaza-ruler Hamas after 11 days of intense fighting remains fragile as both sides try to consolidate their gains. Egypt is mediating discussions between Israel and the Palestinians over longer term cease-fire arrangements.

More immediately, Messrs. Lapid and Bennett face the challenge of bringing together 61 lawmakers to swear in their government in parliament.

Mr. Netanyahu is likely going to try to prevent that by trying to convince some of those lawmakers not to back the new coalition, analysts said.

“During this process the whole 61 that is needed can be attacked, and Netanyahu will continue to do so,” said Reuven Hazan, a professor of political science at the Hebrew University of Jerusalem. “There are elements everywhere that can be picked at.”

Mr. Netanyahu’s Likud party won the most seats in the last election, 30, but he failed in his efforts to unite Israel’s right wing and religious parties around him or to get some of them to work with an Islamist party so he could remain in control.

Mr. Bennett, 49, is a former defense and education minister as well as a former aide to Mr. Netanyahu. He also co-founded an antifraud software firm and made millions of dollars when it was sold. While serving as defense minister he presided over Israel’s first coronavirus lockdown, an effort that was initially viewed as a success. Israel’s coronavirus caseload later skyrocketed after Mr. Netanyahu moved to reopen too quickly but Mr. Bennett by then was no longer part of the government.

From the Archives

Israel is divided over the trial of Prime Minister Benjamin Netanyahu, who faces corruption charges including allegedly accepting gifts such as champagne, cigars and jewelry. WSJ’s Dov Lieber explains. Photo: Gali Tibbon/Associated Press The Wall Street Journal Interactive Edition

Write to Felicia Schwartz at felicia.schwartz@wsj.com