JERUSALEM — Israel's political gridlock has been unbreakable through three brutal elections, endless grandstanding and countless back-channel negotiations. Now, the novel coronavirus could finally give the country its first government in more than a year.

As the virus outbreak — and Israel’s response to it — swelled frighteningly in recent days, the warring factions have softened their rhetoric and embraced, tentatively, the possibility of coming together in an emergency coalition.

At the end of a televised address Thursday in which he announced the closing of all Israeli schools, Prime Minister Benjamin Netanyahu extended an offer of partnership to his opponent, Benny Gantz.

“It will be an emergency government for a limited time, and together we will fight to save the lives of tens of thousands of citizens,” Netanyahu said.

Gantz, in a statement, responded in kind. “Given the circumstances, we are willing to discuss the possibility of establishing a broad national emergency government,” he said.

By the end of the day, the adversaries had talked by phone and consulted with Israeli President Reuven Rivlin, according to a statement from Gantz’s office. The president is scheduled to begin consulting with parliamentary parties Sunday, the next step to naming Gantz or Netanyahu as the person allowed a first chance at assembling a governing coalition.

There is no guarantee the coronavirus-inspired talk will actually lead to Israel’s first functioning government since the Knesset, the parliament, was dissolved in late 2018. Observers say the moves are as much about politics as public health: Netanyahu, whose trial on corruption charges is slated to begin next week, is eager to remain in power; Gantz may have little choice but to acquiesce in a moment of national emergency.

Already, however, the sides are bickering about the role Arab Israeli Knesset members might play in the arrangement; Gantz seemed to insist they participate, while Likud politicians have called them “terrorists in suits.”

But there is no doubt the roaring emergence of the pandemic, which has closed Israel’s schools and all but sealed its borders, has upended the political dynamic as nothing else has during months of stalemate. Covid-19 may not heal the country’s stark political divisions, but it might prove to be the kind of bolt from the blue needed to break the logjam.

“None of us could have in any way predicted this coronavirus thing changing circumstance like this,” said Anshel Pfeffer, a columnist for the English-language daily Haaretz and author of a recent biography of Netanyahu. “It’s a whole flock of black swans.”

Previous attempts to form a unity government — a power-sharing agreement in which rival parties agree to divvy up the cabinet ministries among them — faltered after the most recent election. Rivlin tried to broker such a deal between Netanyahu’s Likud party and Gantz’s Blue and White, but they could not agree on which leader would get to hold the top job first.

Netanyahu would like to hold on to office not only to extend his already record-breaking 13 years of rule. He reportedly sees remaining in power as a way to fend off his looming prosecution, either by having the trial delayed or securing formal immunity. The prime minister faces multiple counts of bribery, fraud and breach of trust stemming from his relationship with wealthy supporters.

Since the March 2 election failed again to give either side a majority, the rancor between the two politicians has grown even uglier. Gantz, a former Israeli army chief of staff, dug in on his pledge to never serve in a coalition with Netanyahu. Netanyahu railed that Gantz was trying to steal the election by pushing for a law blocking an indicted prime minister from forming a government.

It briefly looked as if Gantz was in reach of forming a minority government with outside support from the group of Arab Israeli politicians, which won 15 seats running as the Joint List. That prospect seemed to collapse when a member of one of his partner left-wing parties refused to participate with Arab support, leading to speculation that she had cut a deal for a role in a Netanyahu government.

But as the familiar carousel of recrimination, betrayal and false starts turned and turned, coronavirus headlines began to dominate. Officials layered on restrictions — sending tens of thousands into quarantine, requiring all international arrivals to self-quarantine, shuttering schools for six weeks — and the political tone grew more sober.

Israel has reported at least 150 cases of the infection and no deaths. But officials fear for an already overtaxed national health system. Some Israeli hospitals, which have the highest occupancy rate of any developed country, were already known to park patients in corridors when beds run short.

“The degrees of freedom that Israel has to deal with a deadly infectious disease are extremely low,” said Dan Ben-David, president of the Shoresh Institution for Socioeconomic Research at Tel Aviv University.

Politically, the change of subject may have helped Netanyahu, who has smoothly shifted from brawling politician to soothing crisis manager.

“This is moment he’s been waiting for all his life, to be Israel’s Churchill,” Pfeffer said.

Whatever the motivations in finally forming a government, plenty of Israelis, dreading the prospect of yet a fourth election, may celebrate if a natural disaster helps to end the political one.