Israel's caretaker prime minister took a gamble with his preemptive strike against Islamic Jihad militants in Gaza, less than three months before he is to compete in general elections to retain his job.
Yair Lapid had counted on Gaza's militant Hamas rulers to stay out of the fight, thus enabling Israel to weaken Hamas' smaller sister group while avoiding a full-blown escalation.
At the same time, he may also have gained political ground ahead of the polls.
With a cease-fire between the sides holding on Monday, after three days of violence, the calculation appears to have been accurate.
Hamas remained on the sidelines as Israeli jets pounded targets in Gaza, killing two Islamic Jihad leaders in targeted attacks, and Israel's missile shield intercepted many of the hundreds of rockets fired by Islamic Jihad.
Long-suffering Gaza civilians once again bore the brunt of the violence, with 44 Palestinians killed, among them 15 children and four women. Israel said some were victims of rockets falling short.
The Egyptian-brokered cease-fire, which took effect late on Sunday, capped one of the shortest rounds of fighting since Hamas took control of Gaza in 2007.
Israel and Hamas fought four wars over the past 15 years, as more than two million Gazans endured a suffocating Israeli-Egyptian border blockade.
Since the last war in May 2021, Lapid and his governing partner Naftali Bennett have tried to create more incentives for Hamas to maintain quiet along the Gaza border, with the implied acknowledgement that this would cement the militants' rule.
As part of this strategy, Israel issued permits for 12,000 Gaza workers to enter Israel, with the promise of handing out more if the situation remains calm. Qatar and Egypt have also been engaged in rebuilding Gaza, with Israel's support.
On Monday morning, Israel partially reopened Gaza crossings that had been closed during the fighting, signalling a quick return to the understandings that were in place before the fighting.
Some said Lapid scored political points at home with the short military campaign.
“Lapid is in a much stronger position than he was before because the main claim against him is he is not experienced enough,” said Gayil Talshir, a political analyst from Jerusalem's Hebrew University.
"He might also be able to claim that he's trying to achieve a change of paradigm” underpinning Israel's Gaza policy.
Going into the Gaza offensive, the centrist Lapid, a former TV host and author, lacked the security credentials that Israelis often seek in their leaders.
It was seen as a glaring weakness as he faces off against former Prime Minister Benjamin Netanyahu, who portrays himself as a security hawk, in November elections.
By Monday morning, Lapid appeared to have burnished his security prowess for beating back what he said was an imminent threat from the Palestinian militant group.
“It's crucial to his campaign,” said Tal Schneider, a veteran Israeli political correspondent. “It's helpful when you have more of a military activity experience when you go into election.”
The events of the past few days also underscored Hamas' shifting priorities, as it focuses on governing and staying in power.
“Hamas doesn't want a war every other day. If it joined publicly, this means destruction of buildings, infrastructure, and the Egyptians played an influential role in preventing Hamas from joining the battle," said Mkhaimar Abusada, a political science professor at Gaza's al-Azhar University.
The Israeli work permits are a lifeline for Gaza's economy, battered by widespread destruction from Israeli strikes over the years and crippling movement restrictions.
The permits are "definitely very important to Hamas as it governs Gaza and has governing responsibilities”, said Hossam al-Dajani, political scientist at the Islamic University of Gaza. Lapid, meanwhile, has signalled other policy shifts.
Throughout the fighting, Lapid has refrained from mentioning Hamas, diverging from Netanyahu, who held Hamas responsible for any fire emanating from Gaza.
At the same time, the outgoing Lapid-Bennett government struck back at any and all fire from Gaza, including incendiary balloons. And Lapid appears to have gone further than self-styled security buff Netanyahu whose strategy largely involved striking Gaza in response to rocket attacks.
Lapid chose a preemptive strike in the most recent round, citing concrete threats by Islamic Jihad.
“This government has a zero tolerance policy for any attempted attacks - of any kind - from Gaza towards Israeli territory,” Lapid said at the onset of the operation on Friday.
Lapid was the architect of the outgoing coalition government — an alliance of eight diverse parties spanning the Israeli political spectrum that was bonded largely by their shared antipathy toward Netanyahu.
The coalition, which for the first time in Israeli history also included an Arab party, ended the 12-year reign of Netanyahu, who was Israel's longest-serving prime minister.
His Yesh Atid party is expected to be the second-largest in parliament in the November elections and he could get a chance at forming a government.
Unlike Netanyahu, who served in an elite unit in Israel's compulsory military in the late 1960s, Lapid was a soldier-journalist at a weekly magazine published by Israel's military.
As prime minister, Netanyahu guided Israel through three wars with Gaza, stepped up a campaign to strike enemy targets in Syria and rattled sabers with Iran over its nuclear programme.
Lapid came to prominence promising to address standard of living issues and became a hero for the mainstream, secular middle class, wooed by his telegenic mien and his pledges to stretch their shekels. They cared little about his less-than-heroic military service.
But Lapid has been unable to break through into other constituencies in part because he has little of a security background.
In his stints in government, he has served as finance and foreign minister, gaining valuable skills in politics, governance and diplomacy but failing to gain security experience.
In the weeks following the offensive, Netanyahu will likely seek to tear down what is seen in Israel as a military achievement. But after having dragged Israel into three, far costlier wars in Gaza, and being unable to stamp out rocket fire from Gaza throughout his decade-plus in power, Netanyahu might not succeed.
“Lapid will be able to claim that the policy he led together with Bennett was more effective than that of the man who is trying to replace him in the prime minister's office,” Anshel Pfeffer, a columnist, wrote in the Haaretz daily.