President Barack Obama apologized to Afghan President Hamid Karzai for the burning of Qurans by NATO troops, calling the act an inadvertent "error," Karzai's office and National Security Council spokesman Tommy Vietor said Thursday.
"We will take the appropriate steps to avoid any recurrence, including holding accountable those responsible," Obama said in the letter, which was delivered by U.S. Ambassador to Afghanistan Ryan Crocker.
Afghanistan has erupted in violent demonstrations since the burning of the Islamic religious material by NATO troops at the beginning of the week.
Two American troops were killed Thursday by a person wearing an Afghan National Army uniform, a U.S. official said, asking not to be named discussing casualties.
It is not clear if the troops were killed in revenge for the burning of Qurans, but the attack occurred at a base outside of which a demonstration was taking place, a local official said.
The protest and shootings came as the Taliban called on Muslims to attack NATO military bases and convoys and kill its soldiers following the admission that NATO troops had incinerated Islamic religious material at Bagram Airfield.
At least two demonstrators were killed when gunfire was exchanged near the base in Nangarhar province, said Haji Mohammad Hassan, chief of Khugyani district in the east of the province.
Two U.S. soldiers and seven demonstrators were injured in the clash, he said.
"We don't know who started the shooting first and what kind of guns were used, but we have started our investigation to find out the details of the incident," Hassan told CNN.
He said there were 200 to 300 demonstrators at the protest, which he said was now under control.
There was also a larger demonstration near a Norwegian-run Provincial Reconstruction Team compound in Maimana, the provincial capital of Faryab province, a regional police spokesman said.
Afghan security forces prevented the demonstrators, who number between 700 and 800, from getting into the compound, said police spokesman Lal Mohammad Ahmadzai said.
They burned a few civilian vehicles parked near the compound, he said.
American diplomats in Kabul and the north and south of Afghanistan are on lockdown for a second day in the face of protests, U.S. Embassy spokesman Mark Thornburg said.
At least five people were killed in demonstrations Wednesday.
The commander of NATO's International Security Assistance Force, Gen. John Allen, apologized Tuesday for the incineration of the materials and said it was a mistake.
The materials were gathered for disposal and were inadvertently given to troops for burning, Allen said.
The Taliban Thursday rejected the apology.
In an e-mail message, the Islamist militia accused "the invading infidel authorities" of trying to calm the situation with two "so-called show(s) of apologies, but in reality they let their inhuman soldiers insult our holy book."
They called on Afghans to take revenge "until the doers of such inhumane actions are prosecuted and punished."
"We should attack their military bases, their military convoys, we should kill their soldiers, arrest their invading soldiers, beat them up and give a kind of lesson to them that they never dare to insult the holy Quran," the message said.
Afghan religious scholar Anayatullah Baligh said it can be appropriate to burn a damaged Quran to dispose of it, but that it should be done by a Muslim who is performing the act respectfully.
"I can't tell you whether Americans intentionally burned the copies of the holy Quran to make Muslims angry or if they did it mistakenly," he said, but said their "carelessness" was "a crime they have committed against the holiest book of two billion Muslims around the world."
In his apology for the burning Tuesday, Allen said: "It was not a decision that was made with respect to the faith of Islam. It was a mistake. It was an error. The moment we found out about it, we immediately stopped and we intervened."
A military official told CNN Thursday that it was unclear at this point how many Qurans were involved in the improper disposal and accepted that some had been partially burned.
American troops at the base would not have been able to read the texts and that would have contributed to the mistake, the official said, asking not to be named discussing an ongoing investigation,
He also said it was not clear what method of disposal had been intended for the texts.
A second military official said earlier the materials were removed from a detainee center's library because they had "extremist inscriptions" on them and there was "an appearance that these documents were being used to facilitate extremist communications."
But Allen's words were not enough to appease angry Afghans, who massed outside the Bagram base Tuesday, chanting "Death to America! Death to the Afghan government! Long live Islam!"
Protesters burned tires and threw rocks outside Camp Phoenix Wednesday, close to the Kabul International Airport, the U.S. Embassy said in its official Twitter feed. It asked Americans to avoid the area, saying the protests had "turned violent." It also suspended all travel.
In Jalalabad, the capital of Nangarhar province, hundreds chanted "Down with America" as crowds gathered near the local airport.
Authorities have questioned some troops as part of their investigation, but had not detained anyone, a coalition official said.
U.S. Deputy Defense Secretary Ashton Carter apologized Karzai during a meeting at his presidential palace, according to Karzai's office.
Muslims believe the Quran is the word of God, so holy that people should wash their hands before even touching the sacred book, which is why Quran burning incites such fury.
Desecrating the book is seen as an affront -- an act of intolerance and bigotry.
Last year, when controversial Florida pastor Terry Jones presided over what he called a trial of the Quran and burned a copy, Afghans took to the streets by the thousands. In the northern Afghan city of Mazar-e Sharif, demonstrators stormed a U.N. office and killed 12 people. In Kandahar, three people were killed in one demonstration, and nine in another when police and stone-throwing demonstrators clashed.
American officials vociferously condemned the pastor's act.
In 2010, Afghans protested outside the Forward Operating Base Mirwais in response to an alleged Quran burning inside the base. But coalition forces said the suspected burning was a routine burn-pit session in which military documents are destroyed.