Image caption A large crowd of protesters gathered outside the sprawling Bagram air base

The Nato commander in Afghanistan has apologised over reports foreign troops may have burnt copies of the Koran.

Announcing an inquiry, US Gen John R Allen said any "improper disposal" of religious materials was inadvertent.

Reports suggest the books were taken from prisoners after the US uncovered a secret Taliban message system.

Rumours that a Koran had been burnt led to protests outside the US base at Bagram north of Kabul. One man was hurt when Nato troops fired rubber bullets.

President Hamid Karzai condemned the reports that the Koran had been burnt, as did the Taliban who said the incident would hurt the feelings "of one billion Muslims around the world".

US Defence Secretary Leon Panetta called the incident "inappropriate and deeply unfortunate".

"These actions do not represent the views of the United States military," Mr Panetta said in a statement apologising to the Afghan people. He promised to review the results of the investigation.

Analysis The US military is in full damage-limitation mode, with Gen Allen making two contrite television apologies. Afghan security forces have been put on alert nationwide amid fears of a repeat of the bloodshed that followed news of a Koran being burnt last year in the US. This latest incident may have begun with the Americans uncovering a secret message system between suspected Taliban prisoners. The Americans confiscated the Korans and other religious documents because they believed prisoners were using them to hide messages to each other, two senior Afghan officials told the BBC. A military official familiar with the investigation gave a similar account, but it's still not clear why the Americans would then burn these books.

Police told the BBC that at least 1,000 people took part in the demonstration earlier on Tuesday and that some elders went into the base to talk to Nato officials.

Afghan officials told the AP news agency that the Korans were in rubbish that two soldiers with the US-led coalition transported in a lorry late on Monday night to a pit on the base where waste is burned.

When five Afghans working at the pit noticed the religious books in the rubbish, they stopped the disposal process.

"Foreign troops tried to burn a container of holy Koran books at three o'clock in the morning, but the Afghan mujahideen employees working at the base did not allow them," protester Mohammad Zahir told the BBC.

A BBC reporter at the protests said he saw people crying over claims that foreign troops had set fire to the Koran, while others threw stones and fire bombs at the security forces.

A photographer for the AFP news agency said that guards at the base fired rubber bullets from a watchtower as the crowd shouted "Allahu akbar" (God is great).

Afghan officials told the BBC that the Americans had confiscated books and other documents from suspected Taliban prisoners at the Parwan detention centre next to Bagram base because they believed they were using them to send messages to each other.

Media playback is unsupported on your device Media caption Gen John R Allen: 'When we learned of these actions, we immediately intervened and stopped them.'

It is thought that documents containing extremist inscriptions were taken from the library, says the BBC's Andrew North in Kabul. An unknown quantity of these materials were then burnt, according to military officials, among them some Korans.

'Sincere apologies'

In his statement, Gen Allen said that the investigation would examine whether troops "improperly disposed of a large number of Islamic religious materials which included Korans".

"The materials recovered will be properly handled by appropriate religious authorities," the statement said.

"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."

Previous tension points January 2012: US and UN officials describe a video clip of US marines urinating on dead Afghans as "disgusting" and "inhuman"

April 2011: US President Barack Obama describes March 2011 Koran burning by a radical US pastor as "intolerance and bigotry". The incident triggered protests which left at least 24 people dead in Afghanistan

April 2008: Dutch and Danish governments evacuate their embassies in Kabul after protests against cartoon of the Prophet Muhammad which was reprinted by Danish newspapers 'Rebranding' US detention in Afghanistan

Gen Allen went on to offer his "sincere apologies for any offence this may have caused", to the president of Afghanistan, the Afghan government and "the noble people of Afghanistan".

Later, the Nato-led International Security Assistance Force (Isaf) force said it intended to invite Afghans to join the investigation "so we are transparent with this issue".

"These were religious materials that were gathered up at the detention facility in Parwan and inadvertently given to troops for burning," the Isaf statement said.

"We are still trying to determine if and/or how much got burned before the mistake was discovered.

"If a Koran was damaged, we will find out how it happened and make certain that this does not happen again."

Media playback is unsupported on your device Media caption Brig Gen Carsten Jacobson described how the alleged burning of Korans came to Isaf's attention

Correspondents say that it was a remarkably candid statement by Gen Allen - played repeatedly on Afghan television - apparently aimed at damage limitation after similar incidents led to violence and attacks on foreigners.

Kandahar Governor Tooryalai Wesa strongly condemned the alleged Koran destruction, which he described as a "shameful move by some stupid individuals".

The BBC's Andrew North says reports of the Islamic holy book being mistreated, whether substantiated or not, have proved incendiary in Afghanistan in the past.

The Taliban and other groups have sometimes been accused of spreading such reports to spark violence, but last year protests erupted in Afghanistan after news emerged that an American preacher had set a Koran on fire in Florida.

At least 14 people, seven of them UN workers, were killed in the northern city of Mazar-e Sharif. Another 10 people died in unrest in Kandahar the following day. Dozens of others were injured.