This weekend, as the barbarous, bigoted Saudis charmed another American president, average Iranians fought back against religious tyranny with the only weapon they had: the ballot. Despite hardliners stacking the deck, the nominal reformist candidate, President Hassan Rouhani, won by a landslide.

In his speech Sunday in Riyadh, the capital city that gave us 9/11, our president wisely stated that our quarrel isn’t with the Iranian people. And it shouldn’t be. The majority of Iranians — especially the young — want to see the end of the dictatorship of the clerics and the Revolutionary Guards as badly as we do.

Yet violent confrontation with Iran, barring benevolent acts of God, appears inevitable. Increasingly unpopular, Iran’s bitter, repressive rulers need a confrontation with the United States to justify their stranglehold on power. And they’ll likely get it.

The Middle East suffered two seminal tragedies in the 20th century. First, the most backward and fanatical Arabs got the bulk of the oil wealth. Second, in 1979, the shah of Iran was driven out as a naïve West cheered the “end of oppression” and President Jimmy Carter betrayed him. Soon enough, the abuses of Savak, the shah’s secret police, proved to be minor infractions compared to the slaughter inaugurated by Ayatollah Khomeini.

The shah fled his country because he was unwilling to butcher his people to stay in power. The fanatics who succeeded him felt no such compunction: Indeed, the one lesson today’s tyrants in Tehran took from the shah’s fall was “Don’t fold in the clinch.” Today’s clerics, the Revolutionary Guards and the paid thugs of the Basidji gangs will kill as many Iranians as it takes to maintain their grip.

The clerics couldn’t destroy the country’s soul, though. Repeated demands for change have been put down (most recently, when President Obama turned a blind eye to the revolt of Iran’s youth), but the mullahs haven’t been able to smash Iranian — Persian — civilization, or even suppress pre-Islamic traditions. Persian culture is remarkably powerful.

Today, despite the mullahs’ heavy hand, Iran’s society is far more liberal and just than that of Saudi Arabia, which our enraptured president praised effusively. Women in Iran can not only drive, they can vote, work and (Allah save us!) talk to a male in public. In the celebrations after the election results were announced, men and women took to the streets together. And those women were not veiled from head to toe.

At precisely the same time, American country singer Toby Keith serenaded a male-only crowd in Saudi Arabia.

Who do you think had more fun?

Iranian activists and artists take great risks to eke out more freedoms. Satellite dishes are everywhere. Today’s Iranian films are brilliant, brave and socially engaged — and vastly more interesting than Hollywood blockbusters. The Iranian people are waiting for their moment, while the clerics struggle to freeze the hands on the clock.

The problem’s as old as human governance. The guys with the muscle have the power over the majority. And the Revolutionary Guards have built a corrupt financial empire.

They’ll go down fighting, if they ever go down.

Meanwhile, Iran’s rulers make bloody mischief across the Middle East and go out of their way to provoke the United States. Eventually, we’ll be forced to respond. And that will excuse the next crackdown.

This is strategy as tragedy.

American apologists for the Saudis will claim that the Iranian election was a sham, that there was no difference between the candidates. But the Iranian people saw a difference and turned out in record numbers (were the candidates ideal in our own last election?). Iranians hope that the victorious candidate, President Hassan Rouhani, will gain a bit more leverage to institute reforms because of the ballot count.

Meanwhile, this weekend saw our president give a sturdy, practical speech that, essentially, called on Sunni-Muslim states to take on the Shia minority as embodied in Iran. On one hand, the speech was an essential corrective to Barack Obama’s groveling to Islamists. On the other, it aligned the United States yet again with one of the most repressive regimes on earth, the Kingdom of Saudi Arabia, which has mastered the art of bribing the US to fight wars on its behalf.

Let’s hope, against the odds, that the Iranian vote will prove an impetus for change, however gradual. That would be far better than fighting our natural ally on behalf of the kingdom that brought us 9/11.

Ralph Peters is Fox News’ strategic analyst.