Given the tortured logic he offered in justification, many might be hard-pressed to comprehend that President Trump is entirely correct on one point: Abandoning Saudi Arabia “would be a terrible mistake.”

Yet that doesn’t justify treating the kingdom like the senior partner in this alliance.

Trump has sparked bipartisan outrage by seemingly exonerating Crown Prince Mohammed bin Salman of involvement in the murder of Jamal Khashoggi — and suggesting that, either way, it doesn’t really matter.

The president’s main concern seems to be economic: He cited Riyadh’s role in stabilizing oil prices, its US investments and lucrative arms deals in saying he was “not going to destroy the economy of our country.”

The points are valid, but it’s a mistake to frame everything in terms of dollars and cents — not least because it suggests US foreign policy is for sale.

On the other extreme are those eager to ignore geopolitical realities and America’s legitimate security interests — as well as the complex decades-long history of US-Saudi relations. Saudi Arabia is critical to US interests in countering Iran, fighting terrorism and protecting Israel.

As Sen. Lindsay Graham (R-SC) admits, “We have to deal with bad actors and imperfect situations on the international stage.” And Saudi Arabia is a bad actor that shares our broader strategic interests.

But the fact that Washington can’t throw away that relationship doesn’t mean that Trump should meekly submit to the Saudi insistence that MBS played no role in Khashoggi’s death, when US intelligence strongly believes otherwise.

Fact is, the Saudis need us more than we need them — and on many of the same issues. Most obviously, Iran poses a far greater and more immediate threat to Riyadh than to Washington.

To be fair, Team Trump has already shifted since Khashoggi’s killing, in particular by slashing US support for the Saudi war in Yemen. More is likely ahead, as Congress pushes for Magnitsky Act sanctions on MBS personally.

The US-Saudi alliance is important — but it will survive just fine even if MBS falls from power.