JERUSALEM — In May, Benjamin Netanyahu was riding high. He had just started his fifth term as Israel's prime minister after surviving a string of near-death elections, had co-opted his main rival into a unity government and was enjoying a surge in popularity after successfully leading the country through the initial onslaught of the coronavirus.

Just two months later, with Israel suffering a second wave of infections, the prime minister finds himself enduring a hot summer of collapsing poll numbers, swelling protests and dissenting lawmakers. Even some of Netanyahu’s fellow Likud party members have challenged his handling of the resurgence, a break in the ranks rare for Israel’s longest-serving leader.

Netanyahu’s quick turn from dominance to defense is a further illustration of the pandemic’s power to upend governments and humble highflying leaders — as it has in the United States, where surging infections have imperiled the reelection of President Trump.

By quickly sealing the country, closing schools and imposing a nationwide lockdown when the virus first erupted here in February, Netanyahu won plaudits for making Israel a coronavirus success story. Now, he is the focus of blame for rising cases and the crumbling of the economy, with unemployment soaring to 22 percent. Less than a third of Israelis now say they trust the prime minister to handle the pandemic, down from 56 percent in early April.

“Most of his achievements have collapsed,” said political analyst Aviv Bushinsky, Netanyahu’s former chief of staff and media adviser. “It’s a 180-degree difference in the way he coped with the first wave of the virus.”

Protests against the prime minister in Tel Aviv and outside his residence in Jerusalem have grown almost nightly, some turning unruly. Police used water cannons to disperse a crowd Saturday night, and on Tuesday they arrested 34 people during a protest by thousands of Israelis against a proposal to grant Netanyahu new emergency powers.

Nor will the prime minister’s life get much easier in the months ahead as his trial on public corruption charges prepares to move into a new phase with testimony from witnesses and the review of other evidence.

Anger against Netanyahu mounted after the virus roared back following the country’s reopening in May as he seemed to turn his attention to other issues, including a push to annex Jewish settlements in the occupied West Bank. That proposal is now delayed. He also had a parliamentary committee grant him personal tax exemptions worth more than $200,000 related to renovations on his private home in Caesarea. With unemployment at historic levels, Netanyahu later apologized for the timing of that request.

His performance in tackling the second wave of infections has been panned as erratic and indecisive. With cases climbing to new heights, the government imposed scattershot restrictions and closures on restaurants and retail, only to rescind many of them just as quickly.

Last week, in hopes of avoiding a return to a general lockdown, Netanyahu announced a weekend curfew aimed at stemming public gatherings for leisure activities. Many of those strictures, which included closing beaches on their busiest days, were swiftly reversed after criticism that they would add to the economic pain while doing little to curb viral spread. The head of the Israeli Association of Public Health Physicians said the measures “lacked logical sense.”

The government’s efforts to help out-of-work Israelis have also been rocky. Critics said Netanyahu’s hastily announced plan to distribute $1.7 billion in lump-sum payments to every Israeli smacked of desperation.

Economists, including the ­Netanyahu-appointed governor of Israel’s central bank, condemned the policy as ill-
conceived. Officials of Netanyahu’s Finance Ministry complained publicly that they had not received advance notice of the plan, which threatened to scramble the state budget. Netanyahu loyalists responded by attacking “clerks” who presumed to question the prime minister.

On Sunday, Netanyahu’s cabinet effectively sidestepped him and reworked the plan to provide more-targeted relief.

“It’s a kind of zigzag of policies that make people ask themselves, ‘Do these guys know what they are doing?’ ” said Mordechai Kremnitzer of the Israel Democracy Institute. “I think public confidence in the government is more or less shattered.”

Netanyahu’s office declined to comment for this article.

His supporters say he is being hamstrung by unaccountable bureaucrats and judges and hostile coalition partners. Still, his experience over a decade in power has left him with the skills to handle the cascading challenges, they say.

“In all of this, he manages somehow to hold all the balls in the air,” said longtime supporter Gadi Taub, a political commentator and professor at the Federmann Public Policy Institute at Hebrew University. “What is happening is a multilayer crisis, but also a stark demonstration that he is the only responsible adult in the room.”

Since the virus returned, the government response has been defined — critics say hobbled — by infighting.

The Health and Finance ministries have clashed over public health restrictions that could further choke the economy. Inside the cabinet, rival factions aligned with Netanyahu and Benny Gantz, the “alternate” prime minister under terms of the two-month-old unity government, are often at odds.

And a coronavirus committee in the Knesset, Israel’s parliament, has overturned new rules coming from Netanyahu’s administration. The committee, led by a Likud lawmaker, blocked moves to close public swimming pools, beaches and gyms, saying scientific data didn’t support the restrictions.

Following those reversals, other Likud members moved to oust the committee chairwoman, Yifat Shasha-Biton, until a political outcry forced them to back down. Media reports have suggested that Netanyahu is still angling to replace her.

“There are cracks in his ability to lead and other politicians feel it,” Bushinsky said. “In a different era, no one would have dared do such a thing.”

During earlier efforts to confront the outbreak, the prime minister was able to command the response, appearing as the mask-covered face of the Israeli coronavirus fight personally directing the ministries to take dramatic action.

“In the previous round, we were working under a transitional government and didn’t have a parliament, and it was much easier,” acknowledged a senior government official, who spoke on the condition of anonymity to discuss internal deliberations.

The official attributed the current dissension largely to a lack of scientific data about how the virus is transmitted in various settings.

“I think what we are seeing here is the collapse of the image of a magician,” Kremnitzer said. “He was successful in conveying to the public that it was his show, that even corona could be defeated by him. Now they see something different.”

Few commentators predict the imminent downfall of a politician who has made a routine of resurrecting his political fortunes whenever his career seemed imperiled. And he has sidelined most of his potential Likud rivals. But Netanyahu’s troubles have quieted talk that he was poised to maneuver Gantz out of power through early elections.

“I don’t think he’s ever faced such a crisis in his leadership,” Kremnitzer said.