UNITED NATIONS — Afghan President Hamid Karzai on Tuesday said the production of an anti-Islam film and publication of cartoons perceived as insulting to Muslims cannot be justified as freedom of speech or expression, but that they also must not be used as an excuse for violence.

“The world is shaken by the depravity of fanatics who have committed acts of insult against the faith of over 1.5 billion Muslims,” Mr. Karzai told the U.N. General Assembly.

“We strongly condemn these offensive acts, whether it involves the production of a film, the publication of cartoons, or indeed any other acts of insult and provocation,” he added.

The low-budget film that mocks Islam’s prophet Muhammad was produced in the U.S. President Obama and Secretary of State Hillary Rodham Clinton have condemned it, as did several world leaders who addressed the U.N. session on Tuesday. Mr. Obama, too, focused a large part of his address earlier in the day on the film and the deadly protests that followed in the Muslim world. Four Americans, including Chris Stevens, the U.S. ambassador to Libya, have been killed in the violence.

Mr. Karzai said the production of the film and publication of cartoons lampooning the prophet can “never be justified as freedom of speech or expression.”

“Equally, they cannot give reason for the genuine protests to be used to incite violence and chaos with terrible losses of innocent lives,” he added.

The Afghan leader expressed concern over “the menace of Islamophobia,” which he described as a “worrying phenomenon that threatens peace and coexistence among cultures and civilizations.”

Mr. Karzai called on Western leaders, politicians and the media, to confront Islamophobia. “We must work to defeat the protagonists of the conflict of civilizations, and support the voices of tolerance and understanding,” he said.

On the issue of terrorism, Mr. Karzai reprised his often-repeated assertion that its roots lay beyond Afghanistan’s borders — a thinly veiled reference to Pakistan.

“It is in deference to the immense sacrifices of the Afghan people, and the precious lives lost from the international community, that the campaign against terrorism must be taken to the sources of terrorism and must be result-oriented,” he said.

Mr. Karzai urged the U.N. to remove sanctions on Taliban leaders so as to facilitate direct negotiations with the militants.

He said he was hopeful Pakistan would play a critical role in the reconciliation process, but that incidents such as the recent shelling of Afghan villages risked undermining efforts by both governments to work together.

Pakistani President Asif Ali Zardari, who addressed the session earlier in the evening, said his country supports the Afghan government’s efforts make peace with terrorists.

Mr. Zardari said a search for peace must be “Afghan-owned, Afghan-driven and Afghan-led” and that Pakistan would support any process that “reflects Afghan national consensus.”

The Taliban considers Mr. Karzai a Western puppet and has refused to hold peace talks with his government.

The Taliban broke off peace talks with the U.S. in March. It cited, as one of its reasons for its decision was that the Obama administration had not released five high-value Taliban operatives from the U.S. military detention facility at Guantanamo Bay, Cuba. This was a key demand of the Taliban when it signaled its willingness to start official peace talks with the U.S. in January.