JERUSALEM — When a U.S. strike killed Iranian Maj. Gen. Qasem Soleimani last week, it gave Israeli Prime Minister Benjamin Netanyahu three things he dearly wanted: a strong blow against Iran, relief from growing fears that President Trump was backing out of the Middle East and a change of subject from the corruption indictments dogging him two months before a national election.

Of the three, it seems as if Netanyahu’s reprieve from the media’s focus on the corruption cases may be the shortest-lived. Three days after the U.S. drone strike, Netanyahu’s efforts to shield himself from prosecution had returned to Israel’s front pages.

To be sure, the killing of Soleimani, considered the mastermind of Iran’s regional terrorism apparatus, was still welcomed here Monday. After growing frustration at Trump’s apparent unwillingness to confront Iran more directly, his surprise decision to target the powerful Iranian commander was deemed a “strategic miracle” by at least one Israeli commentator.

“This reversal in American military policy in the Middle East did not entail any Israeli diplomatic or military steps that would have carried a high price,” Alex Fishman said in the Hebrew-language Yedioth Ahronoth. “President Trump chose to stick his own hand into the fire.”

For Netanyahu, a hawk, any shift of focus from his legal woes to regional security is considered an advantage. The election campaign has been overshadowed by the corruption allegations against Netanyahu, who was indicted in November on charges of bribery, fraud and breach of trust. He has refused to resign or drop out of the race, and last week he formally requested parliamentary immunity from prosecution.

But Friday, after the U.S. drone strike, the issue of security temporarily eclipsed the corruption scandals.

“People feel secure with Bibi,” said Gil Hoffman, chief political correspondent for the Jerusalem Post, using Netanyahu’s nickname. “If we’re talking about security, they will feel, ‘If it ain’t broke, don’t fix it.’ ”

Israeli officials have declined to say whether they were briefed ahead of the U.S. operation, although most analysts assume the Netanyahu administration was given at least some notice. The officials were equally mum on the more sensitive question of whether Israel provided intelligence or other support to the operation.

Netanyahu’s chief political rival, former military chief of staff Benny Gantz, joined him in hailing the killing of Soleimani. But it is Netanyahu who has promoted himself as uniquely influential over Trump. Regardless of whether he lobbied directly for the strike, he would be the one likely to benefit.

“We have no idea if he had any influence at all, but voters will give him credit because he’s Trump’s rabbi,” Hoffman said.

Trump’s surprise escalation against Iran is just the latest of the policy shifts that Netanyahu has long sought from Washington, including moving the U.S. Embassy to Jerusalem and increasing support for Israel’s position on settlements in the West Bank.

But after a weekend dominated by the coverage of the attack on Soleimani’s convoy near Baghdad’s airport, Israeli media on Monday was again filled with news of Netanyahu’s electoral and legal struggles. How rising tensions with Iran play out in coming weeks, including the possibility of retaliatory attacks on Israel, will determine what effect they have politically.

Tal Schneider, diplomatic and political correspondent for the Israeli newspaper Globes, said that Soleimani’s killing had redirected the news cycle in Israel but that it could not yet be seen as a boost for Netanyahu’s campaign.

“It is too far before election day, and it could also be very harmful for Israel,” said Schneider, noting that Netanyahu’s response to the killing was muted.

“If Israel comes under direct attack from Iran, then who knows what will happen,” she said. “Historically, if there is a war and if there are casualties, the sitting prime minister is blamed.”

In the meantime, Netanyahu continues to wrestle with his legal woes. On Wednesday, he submitted a request to Israel’s parliament, the Knesset, for immunity in the cases against him under a law that protects elected officials from prosecution, tying up even further the complicated proceedings against him. Because of the political stalemate in the country, with two elections failing to produce a governing coalition and setting the stage for an unprecedented third election within a year, the parliamentary panel that would be tasked with weighing his request does not exist.

On Sunday, under pressure from Gantz’s Blue and White party, the Knesset’s legal adviser, Eyal Yinon, said that even though the parliament was not formally in session, it was permissible for such a committee to be created.

Such a committee would be dominated by opposition lawmakers and would be unlikely to accept Netanyahu’s arguments for immunity. So if that process moves forward, it will set the stage for a very public debate.

Meanwhile, on Sunday, Netanyahu appointed as agriculture minister a man facing the prospect of prosecution on criminal charges. David Bitan is suspected of bribery in 12 criminal cases mostly involving contractors and business executives allegedly funneling hundreds of thousands of shekels in cost to him.

“The Netanyahu government is turning into a criminal organization whose sole purpose is to ensure its leader receives immunity from prosecution,” Blue and White said in a statement after the appointment.