WHEN ANTI-AMERICAN demonstrations spread around the world this month, the Obama administration focused much of its public response on denouncing the anti-Muslim video that had provoked outrage and provided a pretext for extremists. President Obama and Secretary of State Hillary Rodham Clinton rightly distanced the U.S. government from the video and stressed the American system of religious tolerance; more disturbingly, the White House asked Google to consider removing the offending video from its YouTube Web site.

So it was heartening Tuesday to hear Mr. Obama, in his address to the U.N. General Assembly, deliver a vigorous defense of freedom of speech, including the right of individuals to “blasphemy against our most sacred beliefs.”

“Americans have fought and died around the globe to protect the right of all people to express their views — even views that we disagree with,” the president said. Without such freedom, he said, individuals might be stopped from practicing their own faith; “efforts to restrict speech can become a tool to silence critics or oppress minorities.” He concluded: “Given the power of faith in our lives and the passion that religious differences can inflame, the strongest weapon against hateful speech is not repression, it is more speech.”

Mr. Obama went on to denounce violence as a response to speech, and to insist that other leaders speak out against extremism — including “those who — even when not resorting to violence — use hatred of America, or the West, or Israel as a central principle of politics.” The rhetoric was well-targeted: Anti-Americanism has become a tool of extremist and reactionary forces in the power struggles underway in post-revolutionary Arab states. The anti-Muslim video — a vile but obscure piece of Internet flotsam — was seized on by militants in Egypt and Libya as a means for rallying support in Cairo and as a cover for staging an armed assault on U.S. personnel in Benghazi.

It is important for the president and his administration to try to make clear to the majority of Muslims — who do not participate in demonstrations but follow the controversy — that the United States does not sponsor or endorse religious slander. That fact, while obvious to Americans, is not widely understood in the Middle East. But it is just as important to send the message that American free speech will not be curbed to suit religious sensibilities and that violence will not be tolerated. “We will bring justice to those who harm our citizens and our friends,” Mr. Obama said. Delivering on those words will be another important piece of the administration’s response.