President Obama on Friday condemned the attack on a United Nations office in northern Afghanistan and offered condolences to those injured and families of those killed.

Demonstrators reportedly were incensed at the burning of a Koran by a Florida pastor last month. They opened fire on a U.N. office in Mazar-i-Sharif, killing 12 people, including three foreign UN workers and five Nepalese UN guards, officials said.

Two of the foreign dead reportedly were beheaded.

"The brave men and women of the United Nations, including the Afghan staff, undertake their work in support of the Afghan people. Their work is essential to building a stronger Afghanistan for the benefit of all its citizens. We stress the importance of calm and urge all parties to reject violence and resolve differences through dialogue," Obama said in a statement that was read by Press Secretary Jay Carney.

But asked by reporters whether Pastor Terry Jones' Koran burning was the trigger for the protest, Carney said the cause is still being assessed.

"I'm going to refrain for now from commenting on what may or may not have been the cause of the demonstrations that led to these horrific acts ... I'm not going to say anything about it now. I just don't have enough information, we don't have enough information," Carney said.

The State Department also said it was "deeply shocked and saddened" by the reports.

"We condemn this attack on U.N. staff, both international and Afghan, in the strongest possible terms, and convey our deep condolences to the families of the victims and to the leadership of the United Nations. There is no justification for the murder of innocent people," spokesman Mark Toner said.

Sen. John Kerry, D-Mass., chairman of the Senate Foreign Relations Committee who has frequently called for a smaller U.S. presence in Afghanistan, said he was "saddened and angered" by the deaths.

"We and the Afghan people owe a debt of gratitude to the people who risk their lives to make Afghanistan a better place. Instead, an angry mob took out its rage on selfless public servants and innocent bystanders who had no connection to the desecration of a Koran by a radical figure in Florida. My thoughts and prayers are with the families of the victims and with all aid workers who put their lives on the line every day," he said in a statement.