JERUSALEM — Prime Minister Benjamin Netanyahu moved quickly Tuesday to take advantage of his strong showing in Israel's election, signaling a willingness to negotiate with almost any politician as he races to form a government before his corruption trial begins in two weeks.

With 97 percent of the vote in Monday's election tabulated, Netanyahu's unexpectedly large lead was holding firm. The preliminary results showed his Likud party with 36 parliamentary seats, erasing its losses from the previous election last year and making it once again the country's largest party.

If the results hold, his right-wing bloc will command 59 seats, two shy of a majority in the parliament, or Knesset, and the prime minister wasted no time seeking out other parties or lawmakers willing to join his team.

Members of his coalition told reporters they were open to a deal with any party other than the Joint List of Arab parties. Netanyahu's spokesman told Israeli radio that the prime minister's coalition had already made overtures to four potential defectors from left-leaning parties.

But it remained unclear whether he will prove any more successful than after the two previous elections in assembling a majority. Both of those efforts ended in political deadlock, depriving him of a record-breaking fifth term and sending Israelis back to the polls.

Some political observers had said Netanyahu was irreversibly weakened after the longest-serving leader in Israel's history failed to achieve a majority in those previous elections, with his support in decline.

The man known as Israel’s political magician now faces a pair of challenges if he is to stage a comeback: hold successful coalition negotiations and prevail in his upcoming trial on bribery, fraud and breach-of-trust charges.

The election results could still change as officials count final batches of votes from military bases, overseas diplomats and special biohazard polling places set up for voters quarantined because of possible exposure to the coronavirus. (Senior election officials, unable to find workers willing to open the doubly-sealed ballots, were planning to conduct the count themselves in a tent outside the parliament, according to media reports.)

But Israel was well into dissecting Netanyahu’s feat. Polls for months had shown little change in the grinding stalemate that has kept Israel from forming a new government for more than a year.

But in the final weeks, as the Blue and White party and its leader, Benny Gantz, worked down a list of what critics disparaged as overly staid hanger rallies around central Israel, Netanyahu worked tirelessly to electrify his base and reawaken thousands of Likud voters who had reportedly sat out the previous election.

Likud launched what political reporters described as an unprecedented voter-targeting operation. The 70-year-old prime minister appeared all across the country, beseeching supporters to personally lobby their fellow Likud party members and encouraging them to upload video of him to social media.

By the end, in a country exhausted by the nonstop politicking of three straight elections, Netanyahu appeared to dig deeper.

As a candidate, Netanyahu “has phenomenal power,” Topaz Luk, the prime minister’s head media adviser and strategist, said in an interview the morning after the election. “Netanyahu went out to the field this time and did so many rallies.”

Gantz, a former army chief of staff, based his campaign almost entirely on being a measured, ethical alternative to the controversial, divisive and criminally indicted prime minister. Although a majority of votes cast Monday were not in support of Netanyahu, Gantz’s message and manner could not prevent his rival from shouldering past him.

“There is no doubt that Netanyahu enters these coalition negotiations from a strengthened position,” said Yohanan Plesner, president of the Israel Democracy Institute. “Last time he had 55 seats, and now he has 59 seats, so it gives him more options and more legitimacy. The opposite is true for Blue and White, who have gone down.”

Netanyahu has two possible routes to a majority. One is to poach individual Knesset lawmakers. Orly Levy-Abekasis of the Gesher party sparked speculation when she tweeted Monday night that she “hopes to wake up tomorrow to a new era of action.” She removed the post a short time later, after journalists asked whether she was suggesting her willingness to join a right-wing coalition.

The prime minister’s other path is to entice an entire party. Already Tuesday, there were signs that some previously unthinkable deals were being weighed, most notably a merger between the two biggest parties, Likud and Blue and White. The two sides failed to reach a power-sharing agreement after previous elections, and Gantz has vowed never to partner with Likud as long as Netanyahu remains in charge.

But Netanyahu seemed to be leaving that door open in an election night speech that spared Gantz any criticism, even as his Likud supporters chanted for him not to join forces with Blue and White.

And Blue and White may be calculating that Netanyahu’s trial on bribery, fraud and breach of trust, scheduled to begin in two weeks, might put him out of commission in any case.

Netanyahu, who has railed against the justice system, claiming it is biased against him, could now drive the country into a constitutional crisis. He refused to resign following his indictment, raising unexplored questions about a criminal defendant’s ability to perform a prime minister’s duties.

By Tuesday morning, one advocacy group had already petitioned Israel’s High Court to block Netanyahu from being tasked with forming a government in the first place.

“It is unthinkable that a prime minister sit in the defendant’s dock in the morning and run the security cabinet in the evening,” Eliad Shraga, head of Movement for Quality Government, said in a radio interview.