Prince Harry may have been the primary target of an attack on the Camp Bastion military compound in Afghanistan, it has been claimed.

A Taliban commander told Sky News that Harry was the main focus of the attack, but other media organisations reported it was in revenge for an anti-Islamic film.

The prince was unharmed, but two US Marines were killed and several more wounded in Friday night's attack.

Harry, an Army captain, is based at Camp Bastion for his second tour of duty.

US officials said the attack was by heavily-armed insurgents and involved a range of weaponry, including mortars, rockets or rocket-propelled grenades, as well as small arms fire.

Harry was about two kilometres away with other crew members of the Apache attack helicopters, of which he is a co-pilot gunner, when the attack took place, sources said.

There are no indications of any British fatalities or injuries.

A spokesman for the International Security Assistance Force coalition (Isaf) in Afghanistan said the attack happened near an airfield on the north-east side of the base, which houses American forces in Camp Leatherneck.

A Ministry of Defence source said: "After saying this attack was mounted in reaction to the video on Islam, it is entirely predictable that the Taliban have changed their tune to say it was aimed at Captain Wales.

"The insurgency who mounted this attack - most of who were killed by Isaf - were nowhere near Captain Wales, who with other UK and Isaf personnel was under lockdown."