BAGRAM, Afghanistan — Word that NATO personnel had burned an undisclosed number of Korans and were preparing to dispose of many more by incineration set off an angry protest here on Tuesday. NATO officials rushed to apologize publicly and profusely, trying to head off what they feared could be a nationwide outburst of violence as news of the burning was gradually broadcast across the country.

About 2,000 Afghans descended on the largest American air base in their country in the bitter cold to protest what is generally regarded as one of the most offensive acts in the Muslim world.

“I offer my sincere apologies for any offense this may have caused, to the president of Afghanistan, the government of the Islamic Republic of Afghanistan and, most importantly, to the noble people of Afghanistan,” the NATO commanding general, John R. Allen, said in a statement that was recorded and sent to local television and radio networks here, explaining that the burnings had been unintentional.

Within a few hours of learning about the episode, General Allen ordered an investigation, and by day’s end he issued an order for every coalition soldier in Afghanistan to complete training in the next 10 days in “the proper handling of religious materials.”

But 10 years into the Afghan war, foreign officials and Afghans alike were shocked that any member of the foreign forces in Afghanistan did not know just how offensive desecrating the Muslim holy book could be, or recognize the potential for violence it could unleash in a country where news of the burning of a single Koran — by a preacher in Florida — provoked mobs to ransack a United Nations office and kill 12 people in April.

Because Afghans are fiercely protective of their Islamic faith, the Afghan authorities moved quickly to try to control the protest at a gate of Bagram Air Base. The local police and government officials persuaded the crowd at a large demonstration in nearby Kapisa Province to disperse.

According to Afghan workers who witnessed the events, around 10 or 11 p.m. on Monday a dump truck escorted by a military vehicle drove up to the landfill at Bagram Air Base, where 20 or so Afghans work. Two uniformed NATO personnel, a man and a woman, began unloading bags of books from the back of the truck and throwing them into a pit for incineration. NATO officials said it was not yet clear if the two people were troops or civilians. Some civilians also wear military uniforms and can easily be mistaken for soldiers. The Afghan workers described the pair as Americans.

Accounts from some of the workers at the landfill suggested that the two people were oblivious to the significance of what they were doing. They made no attempt to hide the books, instead appearing to be routinely carrying out their duties.

“When we saw these soldiers burning books, we moved closer to see what was going on, and one of the boys said, ‘It is Holy Koran,’ ” said one of the laborers, Zabiullah, 22. “And we attacked them with our yellow helmets, and tried to stop them. We rushed towards them, and we threw our helmets at the vehicles.”

Photo

American soldiers watched a protest that included gasoline bombs on Tuesday outside Bagram Air Base in Afghanistan.Credit
Massoud Hossaini/Agence France-Presse — Getty Images

Abdul Wahid, 25, another of the laborers, said he and two friends had shouted at the two people: “Don’t burn our holy book! We will give it to our mullahs!”

The two NATO personnel drew back, but two bags of books they had already thrown into the pit had begun to burn.

“We tried to put out the fire with bottles of water, and then we pulled back the bags, and the boys also pulled out the half-burned books,” said Zabiullah, referring to his co-workers.

Protests began hours later, as Afghan workers who had seen the burning emerged from the base, one or two of them carrying damaged Korans hidden in their clothes. Protests swelled through the morning and became violent as hundreds of infuriated Afghans set tires on fire and burned an external checkpoint at one of the entrances to the air base.

Shouting “Death to America” and “We don’t want them anymore,” they closed the district government building and stopped people trying to go to the center of the town, witnesses said. Some in the crowd sang Taliban songs, and several Urdu speakers, described as Pakistanis, made speeches.

Photo

One of the scorched Korans that Afghans had prevented from being destroyed was shown to a crowd in Bagram.Credit
S. Sabawoon/European Pressphoto Agency

By early morning Wednesday, several hundred protesters armed with rocks were blocking the way into central Kabul on the Jalalabad road. They were heading to Camp Phoenix , a NATO camp, and were trying to break through the gates. NATO soldiers were watching from towers and had their weapons pointed toward the crowd, but seemed to be trying to avoid opening fire.

The holy books and texts came from the library in the detention center in Parwan, where Americans house suspected insurgents, including many of those captured during night raids. A military official said detainees had been using the books to communicate with each other and potentially incite extremist activity.

In his apology, General Allen confirmed the burnings, but portrayed them as absolutely unintentional. “When we learned of these actions, we immediately intervened and stopped them,” his written statement said. “The materials recovered will be properly handled by appropriate religious authorities.”

“We are thoroughly investigating the incident, and we are taking steps to ensure this does not ever happen again. I assure you ... I promise you ... this was NOT intentional in any way.”

While General Allen and his recent predecessors have tried to improve soldiers’ cultural training and, according to many Afghans, have succeeded in some measure, events like the one late Monday threaten to seriously undermine those gains. Previous complaints about the behavior of foreign forces have involved their actions in night raids, in detention facilities and in day-to-day relations with Afghans.

Video

TimesCast | Protesting Koran Handling

February 21, 2012 - Protests in Afghanistan after an attempt to dispose of copies of the Koran at Bagram air base.

“They have burned our Holy Korans,” said Mohammed Asif, 30, protesting in front of the gates of Bagram Air Base. “We are Muslims and we are created by God and the Koran is our God’s book; we have to defend it. This means they burned our faith, our honor and our lives. The person who did this must stand trial.”

The number of burned Korans appeared to have been around 10 to 15, said Farid Ahad Shafaq, a member of the provincial council in Parwan who went into Bagram Air Base to meet with NATO officials. “We saw the burned copies,” he said. “Some were burned completely, and some were burned a little bit, and some were just exposed to heat.”

Still unclear was how many Korans NATO had planned to burn, said Mr. Shafaq, adding that he and others had not been told exactly where the Korans in the detention center’s library had originally come from. He said military officers had said that “we have gathered all these Korans and holy books during our operations and night raids and house searches, and some have been given to the military personnel as gifts by Afghans working with Americans on the base.”

That did not make sense to Mr. Shafaq, however, because all the copies that the officers showed him were new, he said.

The Taliban called the American action a “wild act” of disrespect to the Muslim Afghans.

Sharifullah Sahak and Jawad Sukhanyar contributed reporting.

A version of this article appears in print on February 22, 2012, on page A1 of the New York edition with the headline: Koran Burning, NATO Blunder, Incites Afghans. Order Reprints|Today's Paper|Subscribe