A coalition of Israeli opposition parties were approaching a midnight deadline on Wednesday to form a government, in the most serious challenge yet to Prime Minister Benjamin Netanyahu's rule. The idea that Israel's longest-serving leader could be unseated became a reality on Sunday, when Naftali Bennett, leader of the small right-wing party Yamina, confirmed he was working toward a coalition agreement with Yair Lapid, leader of the centrist party Yesh Atid. Under the country's election laws, the president can give a party leader 28 days to form a coalition. President Reuven Rivlin had tasked Netanyahu to form a government after the vote, but the Prime Minister was unable to command enough support to control Israel's parliament, the Knesset. The president then tasked Lapid with forming a government, with the deadline of midnight Wednesday. Bennett and Lapid will try to form a coalition with at least eight political parties that run the political spectrum — from the left-wing Meretz, to Bennett's right-wing Yamina party. They will also likely need the outside support of a small Islamist party called the United Arab List in order to be able to reach the 61-seat threshold for a governing majority in the 120-seat parliament. If a deal is agreed upon, parliament will then have a week to vote on any coalition arrangements before a new government and prime minister is sworn in. If Bennet and Lapid fail to meet Wednesday's deadline, the mandate to form a government falls to parliament. If a government isn't formed within the following 21 days, Israel would be on course for a fifth election in just over two years. A source involved in coalition negotiations said on Wednesday that very significant progress had been made overnight and that nearly everything was done. One sticking point is who will sit on the judicial appointments committee. Lapid's Yesh Atid came in second in inconclusive March 23 elections behind Netanyahu's right-wing Likud. Bennett's party won only seven seats in the March vote, but the leader nonetheless finds himself in the powerful role of kingmaker. He had previously announced he was working with Lapid, but had backtracked two days into Israel's latest conflict with Hamas-led militants in Gaza. A few days after the ceasefire was announced, the pair were back at the negotiating table. The parties in the new coalition differ in their stances on some of the country's most pressing issues, especially on relations with Palestinians. But in his speech Sunday, Bennett said he was willing to sit with parties with opposing ideological views to prevent weary Israeli voters from going through another election. Netanyahu blasted Bennett on Sunday for committing what he called the "fraud of the century," portraying him as a power-hungry politician who "only cares about himself." The political challenge comes as Netanyahu remains on trial, charged with bribery, fraud and breach of trust, charges that Netanyahu denies. — CNN