Israel’s caretaker prime minister, Benjamin Netanyahu, has spent three weeks disputing the result of the Oct. 27 election, and on Tuesday the new Parliament chose an ally of his rival, Gadi Eisenkot, as its speaker.

The lawmaker, Matan Kahana, won 66 votes in the 120-seat Knesset, Al Jazeera reported. That’s five more than a majority, and close to the 67 seats that Mr. Eisenkot’s bloc and the Arab-led parties hold between them.

Neither camp won outright. With more than 99 percent of ballots counted, Mr. Netanyahu’s bloc had 53 seats and Mr. Eisenkot’s had 48, according to Al Jazeera, with Arab parties holding 19. Yashar, Mr. Eisenkot’s new party, took 21. Before the vote he had ruled out governing with Arab parties, and now he may need them.

Mr. Netanyahu has responded by calling the result illegitimate. He and his allies say Arab parties stole the election through bribery, foreign money and fraud, and they haven’t produced evidence. Election officials said the results stand and that foreign funding, even if proved, would not overturn them. Mr. Eisenkot called the effort a “despicable and malicious influence operation” meant to delay the results and delegitimize the new Knesset.

A collage shows a hand lifting the lid of a ballot box in front of an empty legislative chamber.

The dispute has reached the Shin Bet. In an analysis for Al Jazeera on Thursday, Simon Speakman Cordall wrote that the domestic security agency, run by David Zini, a Netanyahu ally, reportedly asked to wiretap five Arab lawmakers over suspected foreign interference. It also reportedly sought to arrest politicians who are Palestinian citizens of Israel on Election Day. The attorney general refused both requests.

Law enforcement is now reportedly examining whether the prime minister’s office invented the vote-buying allegations. Yair Lapid, the opposition politician, and Yousef Jabareen, the leader of the Joint List, called the Shin Bet requests evidence of an “attempted coup.”

For Mr. Netanyahu, losing power carries personal risk. He has faced charges of bribery, fraud and breach of trust in three cases since 2019. His trial opened in May 2020 and has been delayed again and again by his official duties. A conviction could bring up to 10 years in prison.

He also faces renewed calls for a state inquiry into the failures before the Hamas-led attack of Oct. 7, 2023. Those calls grew louder after reports that senior Egyptian and Emirati officials had warned him personally, and an inquiry was high on the Knesset’s agenda when its new session opened last week.

A magnifying glass shines over a cracked shield and empty leather chair, with a British government building and torn red, white, and blue paper behind them.

“He is behaving like a wounded animal,” said Ahron Bregman of King’s College London. Leaving office means “losing his shield,” he said, so “nothing is off the table.”

Critics have accused Mr. Netanyahu of stoking a war with Iran to hold on to power. His caretaker cabinet ordered the military last week to prepare for a possible attack.

After the vote, right-wing demonstrators gathered outside Mr. Eisenkot’s home, called him a “traitor” and warned him against governing with Arab-led parties. Some protesters have threatened civil war. Rabbi Gedalia Axelrod, a former head of the rabbinical court in Haifa, invoked din rodef, the “law of the pursuer,” in a public letter. Yigal Amir cited the same principle to justify assassinating Prime Minister Yitzhak Rabin in 1995 over the Oslo Accords.

Negotiators for the two men’s parties met on Sunday to discuss a unity government, but the meeting appeared to be mostly a formality. Both men say they should be prime minister.

Yossi Mekelberg of Chatham House said survival was all Mr. Netanyahu cared about, “no matter what the cost,” but that he “might not succeed this time.”

Ofer Cassif, a Hadash lawmaker who called Mr. Netanyahu “a psychopath” and said his followers could take up arms, put the risk in terms of time. “The longer it takes for Eisenkot to form a government,” Mr. Cassif said, “the higher the risk of political violence becomes.”