After making significant gains against Hamas, Israel is now entering a diplomatic minefield. To serve its own interests, Washington should help Israel secure its victory in Gaza.

Jerusalem proposes a simple formula to end all Gaza wars: Development for disarmament.

Making that “trade” work would help America and our allies in the future.

How so? Well, terror organizations are on the march everywhere.

After killing tens of thousands at the heart of the Arab world, Daesh (a k a ISIS) now threatens to add Lebanese and Jordanian territories to its conquests. Jihadis are gaining in Libya, Somalia, Yemen and elsewhere. In Europe, extremism increasingly dominates Muslim immigrant communities.

We may be able to coast above it all for a while. We did so in the ’90s, all the way up through Sept. 10, 2001.

That brings us to Gaza, where Israel has just finished a month-long war against Hamas, yet another terror outfit.

The Israeli Defense Force managed to rid Gaza of an estimated 60 percent of Hamas’ rockets and missiles, to destroy most of Hamas’ assault tunnels and to kill many Hamas combatants and their supporters.

So diplomats gathered in Cairo are seeking a way to help Gaza recover while also (as they all keep repeating) at last finally addressing the “root causes” of the conflict.

After suffering defeat in battle (which it will never acknowledge), Hamas and its allies want to show Gazans that the war did something for them. Getting Gaza’s borders opened up would prove that the “heroic battle” wasn’t in vain.

Mostly, Hamas wants to open up the Rafah crossing into Egypt — Gaza’s connection to the Arab world. It’s been shut quite hermetically since Gen. Abdel Fattah al Sisi took over in Cairo last year and outlawed both Hamas and its parent organization, the Muslim Brotherhood.

Hmm. Rafah was open, the European Union inspectors there to ensure that no weapons come through, when Hamas seized power in Gaza back in 2007.

Hamas told the EU to skedaddle, and large-scale arms smuggling began — either through the crossing, or under it, in tunnels wide enough for a Mack truck.

And while the world called on Israel to allow in such humanitarian commodities as cement, Hamas used them to solidify its control, and build tunnels.

Now Israel says: Yes, by all means open Gaza up.

As the IDF chief of staff, Lt. Gen. Benny Ganz, said Wednesday, improving lives there is an Israeli interest. But European and/or American inspectors, combined with Israeli, cameras must back the Egyptian and Palestinian Authority officials who’d control the Rafah crossing.

It’s not foolproof. But it allows for partial closure of the crossings if arms start trickling into Gaza — and a full shutdown if they flood in.

Washington understands that any Gaza resolution must include “the disarmament of Hamas and all other terrorist groups,” as Rosemary DiCarlo, our deputy ambassador at the United Nations, put it during Wednesday’s surreal General Assembly session.

But will America insist that there can be no rehabilitation of Gaza until reasonable assurances are in place to prevent its rearmament?

But, again, America has already faced the same problem that challenges Israel in Gaza, and we’ll likely face it again. And the three-step formula has promise:

1) Disarm a belligerent, jihadi-infested region by force.
2) Make sure it doesn’t rearm.
3) Help the locals gain economically until they care more about preserving their assets than about fighting neighbors.

Make it work once, then repeat where needed. It’s one way to win a global war.