As protests swelled at the gates ofBagram Air Base, where the incident occurred, Gen. John R. Allen released a statement apologizing to President Hamid Karzai and the Afghan people.

“ISAF personnel at Bagram Air Base improperly disposed of a large number of Islamic religious materials which included Korans,” General Allen said, refering to NATO’s International Security Assistance Force. “When we learned of these actions, we immediately intervened and stopped them. 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,” he said, “this was not intentional in any way.”

There were unsubstantiated reports circulating among the protesters of NATO personnel taking a load of Korans and starting to burn them.

What is clear is that Afghan employees on the base intervened to stop them, according to a report from an employee on the base and General Allen’s statement.

“I would like to thank the local Afghan people who helped us identify the error, and who worked with us to immediately take corrective action,” General Allen said.

Previous incidents of desecration of the Koran have set off extremely violent reactions in Afghanistan. The last one, when a Florida pastor burned the Koran a year ago, triggered protests across the country, including an outburst in Mazar-e-Sharif in which a crowd overran a United Nations compound and killed 12 people, including seven foreigners.

It is not clear how close the NATO personnel came to destroying the Korans, but one worker, Abdul Wahid, 25, said that “American soldiers brought a pickup truck loaded with new copies of the Koran in its trunk and dropped it in burning pitch and set fire and started burning the Koran.”

Mr. Wahid said that he and two friends tried to stop the soldiers. “We said, ‘We will give it to our mullahs,’” he said.

Western officials said they did not believe that any Korans were actually set on fire, but that an investigation was under way and they would have information later Tuesday.

The crowd at Bagram, estimated at more than 2,000, shouted “Death to America” and “We don’t want them anymore,” according to witnesses who were reached by telephone. Witnesses said gunfire could be heard and security forces were firing rubber bullets.

Some in the crowd were singing Taliban songs and several Urdu speakers, described as Pakistanis, were making speeches to the crowd.

The protesters closed the district government building and stopped people attempting to come to the center of the city.

Western officials warned foreigners to stay at home.

“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,” General Allen’s statement said.