There are many losers in Hamas’ war-crime attack against Israeli civilians. Primary among them are the Israeli women, children and other civilians who have been killed, wounded and kidnapped.
They also include Israeli soldiers as well as Palestinian civilians who are forced to serve as human shields to protect Hamas terrorists.
Hamas terrorists have also been killed, but they deserve no sympathy.
There is one clear winner: Iran.
There can be no doubt about who instigated the attack.
Hamas and Hezbollah are wholly owned subsidiaries of the Iranian mullahs, who call the shots.
Iran’s primary goals are obvious: to prevent a deal between Saudi Arabia and Israel and to sow disarray throughout the region.
The regime may well succeed.
Another goal is to marginalize the Palestinian Authority and elevate Hamas, thus making a two-state solution impossible — because Hamas will not settle for anything less than Israel’s total destruction.
Israel has been trying to deter Hamas and Hezbollah for decades.
Not surprisingly, it’s only worked sporadically.
Whenever Iran wants attacks against Israel to resume, Hamas and Hezbollah follow its orders.
These terrorist groups are not deterrable because they are not the real decision-makers.
Only Iran can be deterred. But it is not being deterred because it’s allowed to benefit when these attacks occur.
Deterrence only works when the decision-makers themselves understand they will be severely hurt, not helped, if they take the actions we want deterred.
The only way to stop Hamas’ and Hezbollah’s recurring attacks against Israel is to treat Iran as the attacker and punish it more than its puppet organizations.
This will not be easy to do, but there are several options, all of which require America’s cooperation.
Israel alone can hurt Iran but not enough to serve as a permanent deterrent.
Primary among the options is the destruction of Iran’s nuclear-weapons program.
If such an attack succeeded, it would be a win not only for Israel but for the entire region as well as for America and for peace.
But the risks of such an attack are considerable, especially if Israel must do it alone. With the help of the United States, the military risks would be reduced.
The successful destruction of Iran’s nuclear program might weaken the government and could ultimately lead to regime change.
The bottom line is that unless Iran is severely punished for instigating terrorist attacks, these attacks will not be significantly deterred by Israeli military actions against the terrorist organizations.
Such actions may slow the terrorists down by destroying their weapons and infrastructure, but it won’t destroy their willingness to follow Iran’s directives.
And Iran will certainly send more weapons and materiel.
Recall as well that Hamas and Hezbollah members are religious fanatics who are not deterred by the risk of death. They welcome becoming martyrs.
Iran, too, is run by religious fanatics, but they are calculating fanatics who would be deterred by credible threats to their nuclear program and regime.
Follow along with The Post’s live blog for the latest on Hamas’ attack on Israel
And many in the Iranian military, scientific and technological areas are more secular than their leaders and capable of being deterred.
This attack Iran orchestrated may provide Israel and the United States their best justification for doing what they have long wanted to do: destroy Iran’s nuclear-weapons program.
Although the international community would publicly criticize such a military action, many world leaders, including in Saudi Arabia and other Arab states, would understand and even welcome it because they realize the world will be better off if the terrorist state of Iran does not have a nuclear arsenal.
One point is clear: Iran is a legitimate military target for Israel. Iran, through its surrogates, has waged war on Israel.
Under international law, Israel has the right to retaliate militarily.
It also has the right to take preemptive military action to prevent the mullahs from obtaining nuclear weapons they have threatened to use against Israel.
A military attack on Iran’s nuclear program would be justified both on retaliatory and preventive grounds.
Alan Dershowitz is professor emeritus at Harvard Law School and the author of “Get Trump,” “Guilt by Accusation” and “The Price of Principle.” Andrew Stein, a Democrat, served as New York City Council president, 1986-94.