JERUSALEM — Prime Minister Benjamin Netanyahu of Israel was facing a midnight deadline on Wednesday to ask Parliament to grant him immunity from prosecution in three graft cases, a decision that demands weighing his own fight for survival against the principle of equality before the law.
An immunity request would be rare and contentious, but it could delay for months the case against Mr. Netanyahu, who faces a general election in two months. And if it is approved, immunity could keep him out of court for as long as he remains a member of Parliament.
Mr. Netanyahu was indicted in November on charges of bribery, fraud and breach of trust. He has denied any wrongdoing.
He has kept the country guessing about his next move, apparently wary that an immunity request could endanger his re-election prospects by fueling accusations of putting himself above the law.
Mr. Netanyahu, Israel’s longest serving prime minister, is running for a fourth consecutive term in the election set for March 2. The country has no limits on the number of terms a prime minister or lawmaker can serve.
The election will be Israel’s third in a year. The campaign was already expected to be divisive and largely focused on Mr. Netanyahu’s fate, and an immunity request would most likely deepen national divides over values and the nature of Israeli democracy. Two earlier elections, in April and September, ended inconclusively, with neither Mr. Netanyahu and his right-wing Likud party, nor his chief opponent, Benny Gantz, of the centrist Blue and White party, able to muster the majority needed to form a viable government.
Mr. Netanyahu is accused of trading official favors worth hundreds of millions of dollars to Israeli media moguls for illicit gifts of cigars, champagne and jewelry, as well as positive news coverage.
Clinging to the premiership — from which analysts say he will be better positioned to fight his legal battle — Mr. Netanyahu has long argued that the criminal investigations against him are the result of a witch hunt led by leftist, elitist forces trying to oust him through “fake news” in the liberal media and through the courts.
On Tuesday, Israel’s Supreme Court held a preliminary hearing on whether a prime ministerial candidate charged with serious crimes can be tapped to form a new government, in response to a petition filed by dozens of members of Israel’s high-tech industry and academia.
The court delayed issuing any ruling, even on whether it would take the case, suggesting that judges might weigh in only if the question becomes less hypothetical after the election. The timing is delicate: Any ruling could potentially be seen as interfering in an election campaign, and the judges are already under pressure from conservative forces that are fighting to curb the court’s influence.
In a video released Monday night, Mr. Netanyahu warned the court not to fall into what he called a political trap laid by people trying to foil his candidacy. “In a democracy,” he said, “the people are the only ones who decide who leads the people, and nobody else.”
But some legal experts have argued that the question is a constitutional one for the courts, and that voters are entitled an answer before they go to the polls.
Mr. Netanyahu has zigzagged on the question of immunity, aware of its unpopularity and the pitfalls of appearing to evade justice. He dismissed the idea before the April election, avoiding handing the opposition damaging campaign fodder. But this week, as the deadline for his request approached, he declared that immunity was a “foundation stone of democracy.”
Many countries, including Israel, have immunity laws to protect lawmakers’ freedom of action and speech in the course of their parliamentary duties.
In Israel, a lawmaker can also seek immunity, under certain circumstances, for alleged crimes not committed in the line of parliamentary duty, for as long as the accused is a member of Parliament. The circumstances listed in the law include if an indictment is not drafted in good faith or is discriminatory, to protect lawmakers from politically motivated prosecution.
Miki Zohar, Likud’s chief whip, said this week that Mr. Netanyahu was the victim of persecution on ideological grounds, and Mr. Netanyahu appears to have been laying the groundwork for such an argument with his assertions of a witch hunt.
Immunity that defends a lawmaker’s freedom of speech is indeed “a constitutional institution that is very important,” said Suzie Navot, a professor of constitutional law at the Striks School of Law near Tel Aviv. “But that is not the kind of immunity that Netanyahu is talking about.”
Under Israel’s immunity law, which was amended in 2005, lawmakers no longer have automatic immunity but must seek it from a parliamentary body known as a House Committee, whose decision must then be ratified by a simple majority in Parliament.
The current, caretaker government has not formed a House Committee, and there may not be one to discuss a request by Mr. Netanyahu for weeks or months after the March election, until a new government can be formed. Court proceedings against Mr. Netanyahu would be frozen until any immunity request could be heard.
It is not clear if Mr. Netanyahu would have a parliamentary majority to grant him immunity. That might depend on Avigdor Liberman, leader of the right-wing Israel Beiteinu party that used to be allied with Mr. Netanyahu’s Likud. Mr. Liberman has advised Mr. Netanyahu not to seek immunity but has not said where he would land if it went to a vote.
Ms. Navot, the constitutional law expert, said the parliamentary process of granting immunity is quasi-judicial, requiring evidence to back up the arguments of the person requesting it, and takes place under judicial review.
It would be very hard to prove that the law enforcement authorities acted in bad faith in the Netanyahu cases, she said, especially given the rigorous caution that Attorney General Avichai Mandelblit, who indicted the prime minister, showed in handling them. Mr. Mandelblit was appointed by Mr. Netanyahu.
Granting Mr. Netanyahu immunity, Ms. Navot said, would be “a fatal blow to the rule of law and equality before the law.”
No lawmaker or minister has been granted immunity since the law was amended in 2005. After Mr. Liberman was charged in 2012, as foreign minister, with fraud and breach of trust in an episode involving the promotion of an ambassador, he resigned. He was later acquitted in court and returned to his post.
A former prime minister, Ehud Olmert, resigned in 2008, under pressure from rivals within his own government, even before he was indicted on corruption charges. He was ultimately convicted and went to prison.