Perhaps under-appreciated in the clutter of the election campaign, President Barack Obama’s speech to the United Nations’ General Assembly has outlined a good path forward for this country in a world troubled by religious fanatics.

The speech came in the wake of yet new evidence of the power of fanaticism to overpower good judgment, and of the use of religious enthusiasms for secular purposes.

Beyond the recent riot at the Cairo embassy, and a deadly terrorist attack on the Benghazi consulate, there is a long history of riots and even deaths inspired by religious fanatics, whether upset by mocking of Islam’s prophet, or burning of Qurans, or other events over which the U.S. government has no control.

So Obama’s speech was first of all an explicit repudiation of violence in the name of God.

“There are no words that excuse the killing of innocents,” Obama declared.

“There is no slander that provides an excuse for people to burn a restaurant in Lebanon, or destroy a school in Tunis, or cause death and destruction in Pakistan,” he added.

After 9/11, when Muslims and Jews perished alike with Christians and Hindus and others in terrorist attacks, Americans might well have been forgiven for thinking that the diversity of Americans lost in that tragedy would emphasize to the world the irrational nature of religious violence against a pluralist country.

Yet if there has been one lesson since then, it is that the world does not get one of the fundamentals of our communal process in this country: freedom of religion.

As we go forward, the world continues to divide violently over questions that in America are mostly argued about, and rarely incite people to violence. For Obama, clearly, the UN speech looked out at a world where American values are not shared but are widely unappreciated.

Among his key points was freedom of speech, in a world where blasphemy is very often a crime, and religious minorities a target.

“Given the power of faith in our lives, and the passions that religious differences can inflame, the strongest weapon against hateful speech is not repression, it is more speech,” Obama said.

And who can control free speech in an Internet world? “When anyone with a cellphone can spread offensive views around the world with the click of a button, the notion that we can control the flow of information is obsolete,” Obama said.

So far so good, but the president also challenged the nations to live the Golden Rule in religious expression: “The future must not belong to those who slander the prophet of Islam. Yet to be credible, those who condemn that slander must also condemn the hate we see when the image of Jesus Christ is desecrated, churches are destroyed, or the Holocaust is denied.”

Extremism will betray the hopes of those in the “Arab spring” of popular movements, the president warned. “It is time to marginalize those who — even when not resorting to violence — use hatred of America, or the West, or Israel as a central principle of politics,” Obama said. “For that only gives cover, and sometimes makes excuses, for those who resort to violence.”

Obama’s speech was not only a wise general policy, but made a specific point better understood abroad than in the United States: The Cairo embassy riot was inspired by both religion and politics. Many Egyptians were offended by a crude anti-Islam video produced in the United States. But the rioters were organized and fueled by a particular Islamic sect that had finished out of the money in the recent Egyptian elections.

In this season of religious holidays for all faiths, and America’s broad secular feast of Thanksgiving, the Obama speech deserves to be heard, as it represents a broader way forward, in which Americans — whether through our diplomats, or their own relationships with friends around the world — should promote an alternative to religious extremists.