JERUSALEM -- A former ally of Prime Minister Benjamin Netanyahu on Sunday said he would seek to form a coalition government with the Israeli leader's opponents, taking a major step toward ending the rule of the longtime premier.

The dramatic announcement by Naftali Bennett, leader of the small hardline Yamina party, set the stage for a series of steps that could push Netanyahu and his dominant Likud party into the opposition in the coming week.

While Bennett and his new partners, headed by opposition leader Yair Lapid, still face some obstacles, the sides appeared to be serious about reaching a deal and ending the deadlock that has plunged the country into four elections in the past two years.

"It's my intention to do my utmost in order to form a national unity government along with my friend Yair Lapid, so that, God willing, together we can save the country from a tailspin and return Israel to its course," Bennett said.

The pair have until Wednesday to complete a deal in which each is expected to serve two years as prime minister in a rotation deal, with Bennett holding the job first. Lapid's Yesh Atid party said negotiating teams were to meet later Sunday.

Bennett, a former top aide to Netanyahu who has held senior Cabinet posts, shares the prime minister's hard-line ideology. He is a former leader of the West Bank settlement movement and heads a small party whose base includes religious and nationalist Jews. Yet he has had a strained and complicated relationship with his one-time mentor due to personal differences.

Bennett said there was no feasible way after the deadlocked March 23 election to form a right-wing government favored by Netanyahu. He said another election would yield the same results and said it was time to end the cycle.

"A government like this will succeed only if we work together as a group," he said. He said everyone "will need to postpone fulfilling part of their dreams. We will focus on what can be done, instead of fighting all day on what's impossible."

If Bennett and Lapid and their other partners can wrap up a deal, it would end, at least for the time being, the record-setting tenure of Netanyahu, the most dominant figure in Israeli politics over the past three decades. Netanyahu has served as prime minister for the past 12 years and also held an earlier term in the late 1990s.

In his own televised statement, Netanyahu accused Bennett of betraying the Israeli right wing and urged nationalist politicians not to join what he called a "leftist government."

"A government like this is a danger to the security of Israel, and is also a danger to the future of the state," he said.

Despite his electoral dominance, Netanyahu has become a polarizing figure since he was indicted on charges of fraud, breach of trust and accepting bribes in late 2019. Each of the past four elections was seen as a referendum on Netanyahu's fitness to rule, and each ended in deadlock.

Netanyahu is desperate to stay in power while he is on trial. He has used his office as a stage to rally his base and lash out against police, prosecutors and the media.

In order to form a government, a party leader must secure the support of a 61-seat majority in the 120-seat Knesset, or parliament. Because no single party controls a majority on its own, coalitions are usually built with smaller partners. Thirteen parties of various sizes are in the current parliament.

As leader of the largest party, Netanyahu was given the first opportunity by the country's figurehead president to form a coalition. But he was unable to secure a majority with his traditional religious and nationalist allies.

Netanyahu even attempted to court a small Islamist Arab party but was thwarted by a small ultranationalist party with a racist anti-Arab agenda. Although Arabs make up some 20% of Israel's population, an Arab party has never before sat in an Israeli coalition government.

After Netanyahu's failure to form a government, Lapid was then given four weeks to cobble together a coalition. He has until Wednesday to complete the task.

While Bennett's Yamina party controls just seven seats in parliament, he has emerged as a kingmaker of sorts by providing the necessary support to secure a majority. If he is successful, his party would be the smallest to lead an Israeli government.

Lapid already faced a difficult challenge, given the broad range of parties in the anti-Netanyahu bloc that have little in common. They include dovish left-wing parties, a pair of right-wing nationalist parties, including Bennett's Yamina, and most likely the Islamist United Arab List.

Lapid's task was made even more difficult after war broke out with Hamas militants in the Gaza Strip on May 10. His coalition talks were put on hold during the 11 days of fighting.

But with Wednesday's deadline looming, negotiations have kicked into high gear. Lapid has reached coalition deals with three other parties so far. If he finalizes a deal with Bennett, the remaining partners are expected to quickly fall into place.

They would then have roughly one week to present their coalition to parliament for a formal vote of confidence allowing it to take office.

Yohanan Plesner, president of the Israel Democracy Institute, said Netanyahu will try to undermine those efforts until the end.

Netanyahu's main strategy, he said, would be to try to appeal to hard-liners in both Bennett's party and New Hope, another hard-line party led by a former Netanyahu confidant, to withdraw their support for the new coalition. A defection of just one or two lawmakers could prevent Lapid from mustering a majority and force another election.

"Anything might happen," Plesner said. "I would wait for the final vote to go through."

Even if Lapid and Bennett manage to put together a government, Netanyahu is unlikely to disappear, Plesner said.

Netanyahu could remain as opposition leader, working to exploit the deep ideological differences among his opponents to cause the coalition to fracture.

"History teaches us it would be unwise to write him off," he said.

------

Associated Press writer Ilan Ben Zion contributed to this report.