Congrats, Hamas: You’ve finally done something comprehensible during this bizarre and goalless war you’ve started with Israel.

Tuesday’s rocket attack on an area near Israel’s only international airport — the success of which marks the first serious failure of Israel’s Iron Dome anti-missile shield — has thrown Israel off-kilter for the first time since the war began.

Carriers panicked by the shootdown of the Malaysia Airlines jet over Ukraine began canceling flights to Israel left and right even before the Federal Aviation Administration grounded all US-Israeli plane travel for 24 hours.

Any effort to restrict travel has an especially powerful resonance in Israel.

In the 15 years leading up to the nation’s founding, Britain sought to do exactly that to Jewish immigration and trade, and part of Israel’s creation story involves the bravery of blockade-running ships (like the fabled Exodus) bringing pre- and post-Holocaust refugees into what was then called Palestine.

Flash forward 20 years. The 1967 Six-Day War, which transformed the map of the region thanks to Israel’s surprising and overwhelming victory, came about because Egypt blockaded the Straits of Tiran — international waters over which Egypt had no authority — in an effort to choke Israel’s tiny economy and bring the country to its knees.

These historical facts are written into Israel’s DNA, and so the impact of the forced closure of Israel’s main point of entry and departure is outsized.

Remember that Israel, with hostile nations and terrorist groups to its south and north and northwest, has no friendly borders, save perhaps for three relatively placid crossings eastward into Jordan.

For all practical purposes, Israelis must get on a plane to get anywhere.

So this was unquestionably an inspired tactical move by Hamas to gain the upper hand psychologically (even if was trying from the start and only made it through Iron Dome on Tuesday).

Israelis have been laboring to maintain a normal existence throughout two weeks of rocket fire and sirens and anti-missile explosions. But any pretense to normality can’t survive such a blockade of the air.

Yet, while the action might have worked tactically, the targeting of Ben Gurion Airport may prove a strategic calamity for Hamas.

The fact that it was preceded by the shootdown of Flight 17 may have enhanced the terror effect inside Israel, but it also suggests a danger the international community (even the large part of it deeply hostile to Israel’s existence) must reckon with.

If Hamas is rewarded now (with a cease-fire on terms acceptable to it) for having threatened air traffic, the terrorist playbook around the world will have a new and terrifyingly low-cost go-to entry.

After Flight 17, even Israel-haters have a profound incentive to ensure any such action is met with profound countermeasures that will create a deterrent effect.

This is not to say that many countries will openly support Israel in its efforts now, but their attacks may be more muted than they’d otherwise be, and any new support Hamas might hope to generate is likely to evaporate.

More important, Israel now has a powerful and very specific reason for continuing a slow and painstaking effort to take out the missiles and the tunnels Hamas has stockpiled and built — all of them, even if it takes weeks, if not months.

For just as no nation can live under constant aerial assault from missiles aimed at population centers, no nation with the power to prevent it can accept the closure of its trade routes and its points of access and exit.

Israel has that power. It has not wished to exercise it in full. Now Hamas may just have given Israel no choice but to wipe out its infrastructure.

Let me be clear: This is not anything to wish for.

It places far too many people at risk — not only Palestinians in the streets of Gaza but tens of thousands of Israeli soldiers, including members of my own family, who would rather be home with their loved ones than risking their lives in parlous circumstances.

There are few desirable options. There are only the best of bad choices. And every drop of blood that has been shed and will be shed is an incarnadine stain on Hamas — and only Hamas — now and evermore.