President Barack Obama has described as "outrageous" the killings in Afghanistan triggered by the burning of a Koran in the US last month.
Mr Obama said the desecration of any holy text was "an act of extreme intolerance and bigotry", but it did not justify killing innocent people.
An attack on a UN base on Friday in the city of Mazar-e Sharif killed 14 people, seven of them UN staff.
A top UN official has blamed the pastor who burnt the Koran for the violence.
At least 10 people were killed and many more were injured in the southern Afghan city of Kandahar on Saturday in a second day of protests.
During a service at the Dove World Outreach Center in Florida on 20 March, Pastor Wayne Sapp soaked a Koran in kerosene, staged a "trial" during which the Islamic holy book was found guilty of "crimes against humanity", and then set it alight.
The incident took place under the supervision of Pastor Terry Jones, who last year drew condemnation over his aborted plan to burn copies of the Koran on the anniversary of the 11 September 2001 attacks on the US.
In a statement published on Saturday evening, Mr Obama extended his condolences to the families of those killed by the protesters in Afghanistan.
"The desecration of any holy text, including the Koran, is an act of extreme intolerance and bigotry," he said. "However, to attack and kill innocent people in response is outrageous, and an affront to human decency and dignity.
"No religion tolerates the slaughter and beheading of innocent people, and there is no justification for such a dishonourable and deplorable act."
The president said it was the time to "draw upon the common humanity that we share, and that was so exemplified by the UN workers who lost their lives trying to help the people of Afghanistan".
Earlier, the head of the UN Assistance Mission in Afghanistan (Unama), Staffan de Mistura, said during a visit to Mazar-e Sharif that the only person who could be blamed for the violence was the American pastor.
"I don't think we should be blaming any Afghan. We should be blaming the person who produced the news - the one who burned the Koran. Freedom of speech does not mean freedom from offending culture, religion, traditions."
He also insisted that Friday's attack "should not deter the UN presence, activities in this country in this delicate and particularly crucial period".
The UN would, however, temporarily redeploy 11 staff members from Mazar-e Sharif to Kabul while their office was rebuilt, he said.
"This is not an evacuation," he added. "We will be ready to go back as soon as we can establish an office that is secure enough."
The authorities in both Kandahar and Mazar-e Sharif have blamed the Taliban for the violence. However, the Taliban has rejected the accusation.
The BBC's Paul Wood says the authorities in Kandahar have blamed the Taliban for the protests
Pastor Jones has said that the Dove World Outreach Center's congregation does not "feel responsible" for the attack.
"The radical element of Islam takes [the burning of the Koran] as an excuse to promote their violent activities," he told the AFP news agency.
Witnesses said the protest in Mazar-e Sharif, which began outside the central Blue Mosque after Friday prayers, began peacefully but suddenly turned violent.
The crowds moved to outside the UN compound, where a small group broke away.
Several demonstrators were killed by guards at the compound, who were then overpowered by the mob.
Munir Ahmad Farhad, a spokesman for the governor of Balkh province, said the group seized weapons from the guards and stormed the building. Four Nepalese guards, a Norwegian, a Romanian and a Swede died.