KABUL, Afghanistan – The U.S. apologized Tuesday for the burning of Muslim holy books that had been pulled from the shelves of a detention center library adjoining a major base in eastern Afghanistan because they contained extremist messages or inscriptions.

The White House echoed military officials in saying the burning of Qurans and other Islamic reading material that had been tossed in a pile of garbage was an accident.

But more than 2,000 Afghans protested the incident outside the Bagram Air Base that stoked rising anti-foreign sentiment and fueled Afghan claims that foreign troops disrespect their culture and Islamic religion even as the Americans and other NATO forces prepare to withdraw by the end of 2014.

Demonstrators who gathered outside Bagram Air Base, one of the largest U.S. bases in Afghanistan, shouted, “Die, die, foreigners!” Some fired rifles into the air. Others threw rocks at the gate of the base and set tires on fire.

U.S. Gen. John Allen, the top commander of American and NATO forces in Afghanistan, said the books had been mistakenly given to troops to be burned at a garbage pit at Bagram, a sprawling U.S. military base north of the Afghan capital of Kabul.

“It was not a decision that was made because they were religious materials,” 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 ... intervened.”

The Quran is the most sacred object in the daily lives of Muslims and burning it is considered an offense against God. The Quran is so important in the faith that Islamic teaching spells out how it should be handled, including directing anyone who touches it to be in a state of ritual purity.

A Western military official with knowledge of the incident said it appeared the Qurans and other Islamic readings in the library were being used to fuel extremism, and that detainees at Parwan Detention Facility, which adjoins Bagram, were writing on the documents to exchange extremist messages. He spoke on condition of anonymity because he was not authorized to release the information.

“We will look into the reason those materials were gathered,” Allen said. “We will look into the manner in which the decision was made to dispose of them in this manner.”

Get the DeKalb County Board newsletter

Our insider newsletter lets you know what's going on with the DeKalb County Board. It's free. Get it today!