Prime Minister Benjamin Netanyahu's opponents announced they have reached a deal to form a new governing coalition, paving the way for the ouster of the longtime Israeli leader.
The dramatic announcement was made by centrist opposition leader Yair Lapid and his main coalition partner, ultranationalist Naftali Bennett.
It came moments before a midnight deadline and prevented the country from plunging into what would have been its fifth consecutive election in just over two years.
In a statement on Twitter, Lapid said he had informed the country's president of the deal.
"This government will work for all the citizens of Israel, those that voted for it and those that didn't. It will do everything to unite Israeli society,'' he said.
Under the agreement, Lapid and Bennett will split the job of prime minister in a rotation.
Bennett will serve the first two years, while Lapid is to serve the final two years. The historic deal also includes a small Islamist party, the United Arab List, which would make it the first Arab party ever to be part of a governing coalition.
The agreement still needs to be approved by the Knesset, or parliament, in a vote that is expected to take place early next week. If it goes through, Lapid and his diverse array of partners will end the record-setting 12-year rule of Netanyahu.
Netanyahu, desperate to remain in office while he fights corruption charges, is expected to do everything possible in the coming days to prevent the new coalition from taking power. If he fails, he will be pushed into the opposition.
The country has been at a political stalemate with four elections in the space of two years proving inconclusive, and allowing Netanyahu to keep hold of the top political job.
An emergency government formed last year between Netanyahu and former military chief Benny Gantz to battle the coronavirus pandemic quickly became mired in political bickering and collapsed in December. That government remains in place as caretaker.
Bennett and Lapid had until midnight to inform the president, Reuven Rivlin, of the coalition deal.
Rivlin for his part is to stand aside shortly as president - a largely ceremonial role - following the election on Wednesday of Isaac Herzog to replace him.
Herzog, the son of former president Chaim Herzog, will be the country's eleventh president.