When U.S. President Donald Trump recognized Israeli sovereignty over the Golan Heights, foreign-policy experts keened in chorus that he was destroying a fundamental principle of the world order: that territory can’t be acquired through force. Let’s hope they’re right—because that principle, far from deterring aggression, actually rewards it.

The problem is that, as currently interpreted, the principle doesn’t distinguish between offensive and defensive wars. Thus for an aggressor, starting a war becomes almost cost-free (assuming he doesn’t care about getting his own people killed). If he wins, he achieves whatever goal he sought to achieve. And if he loses, the international community will pressure his victim to return any captured lands, thereby ensuring that he pays no territorial price.

This warped interpretation is the diametric opposite of the principle’s original purpose, which was to deter aggression. But it’s also of fairly recently vintage. After World War II, the Allies had no qualms about forcing Germany, the aggressor, to cede territory to its victims. And Western nations still recognized the distinction between offensive and defensive war as recently as 1967.

The proof is Security Council Resolution 242, which is famously interpreted today as requiring Israel to cede all territory captured in the Six-Day War of 1967. But in reality, it was explicitly worded to let Israel keep some of that territory, by demanding a withdrawal only from “territories occupied in the recent conflict,” rather than “the territories” or “all the territories.”

As America’s then U.N. ambassador, Arthur Goldberg, later said, the omitted words “were not accidental … the resolution speaks of withdrawal … without defining the extent of withdrawal.” Lord Caradon, the British U.N. ambassador who drafted the resolution, was even more explicit. “It would have been wrong to demand that Israel return to its positions of June 4, 1967,” he said.

What’s noteworthy, however, is that the clause allowing Israel to retain some captured territory was preceded by a preamble clause, “Emphasizing the inadmissibility of the acquisition of territory by war.” In other words, nobody back then saw any contradiction between emphasizing the inadmissibility of acquiring territory through war and authorizing the victim to keep some of the aggressor’s territory because the ban on gaining territory through war was understood as applying to offensive wars, not defensive ones.

And the Six-Day War—in which Israel acquired the Golan Heights from Syria, the Sinai from Egypt and the West Bank, Gaza and eastern Jerusalem from their illegal Jordanian occupier—was a classic defensive war. It began when Egypt closed the Straits of Tiran to Israeli shipping (a recognized act of war), kicked U.N. peacekeepers out of Sinai, massed troops on Israel’s border and publicly threatened to annihilate it.

Moreover, even after Israel opened the war’s hot phase by attacking and destroying Egypt’s air force, it had no interest in opening additional fronts with Syria or Jordan (famously begging the latter to stay out of the war). Nevertheless, both countries promptly launched their own attacks. In Syria’s case, these included shelling civilian communities from the Golan and conducting airstrikes on them.

In other words, Syria could have sat the war out. Instead, it chose to join the anti-Israel aggression, and in the ensuing fighting, it lost the Golan.

Damascus then spent the next 52 years rejecting repeated offers to trade the Golan for peace while also launching one hot war (in 1973) and providing material support for decades of attacks on Israel from neighboring Lebanon (first by the PLO and later by Hezbollah). In contrast, Egypt made peace with Israel in 1979 (thereby recovering every inch of Sinai), while Jordan signed a formal peace treaty in 1994 after having maintained a de facto peace for the preceding 27 years.

Yet despite Syria’s half-century record of aggression and peace rejectionism, the international community never stopped insisting that Israel must return the Golan to Syria. Damascus believed that it would never have to pay any price for its bad behavior—until Trump came along.

Theories about international law presumably didn’t play a major role in Trump’s decision. Yet by insisting that aggression and peace rejectionism shouldn’t be cost-free, he is being more faithful to this law’s original goal of deterring aggression than its professed devotees, who insist that aggressors should never suffer territorial consequences.

That’s why all the foreign-policy experts claiming that Trump has just legitimized acts of aggression like Russia’s seizure of Crimea are wrong. This claim is possible only under the warped interpretation of international law that makes no distinction between offensive and defensive wars. If all territorial acquisitions through force are equally inadmissible, then legitimizing one would legitimize them all. But under the far more plausible interpretation that prevailed as recently as 50 years ago, the Golan and Crimea are completely different cases because the former was acquired in a defensive war and the latter in an offensive one.

Incidentally, the claim that the decision undermines prospects for Israeli-Palestinian peace is also wrong; as Dr. Martin Kramer of Shalem College pointed out, the opposite is true. Until now, the Palestinians have always found peace rejectionism a profitable business; every time they rejected an Israeli peace offer, the international community rewarded them by demanding additional Israeli concessions. But now, Trump has shown that rejectionism carries a price.

By so doing, a president who scoffs at international law may ironically be saving it. International law was never meant to be a suicide pact, but in its modern interpretation, it has increasingly become one. Under this interpretation, terrorists who operate from amid civilian populations enjoy immunity from military action; countries must accept unlimited numbers of migrants fleeing danger; and aggressors can start wars with impunity. Since all this is detrimental to the well-being of ordinary law-abiding countries, if it continues, more and more countries will simply ditch international law in favor of self-preservation.

By recognizing Israeli sovereignty over the Golan, Trump is restoring the distinction that used to exist between offensive and defensive wars, and thereby restoring international law to sanity. Anyone who actually cares about international law ought to thank him.

Evelyn Gordon is a journalist and commentator living in Israel.