Prince Harry was the target of an attack on the Camp Bastion military compound in Afghanistan, according to a Taliban spokesman.
A Taliban commander told Sky News that Harry was the main focus of the attack, but other Taliban spokesmen told media organisations that the attack was in revenge for the anti-Islamic film The Innocence of Muslims.
Two US marines were killed and several more wounded in Friday night’s attack but there is no indication that it took place anywhere close to the location of Prince Harry.
In a separate incident, a British soldier from 1st Battalion Grenadier Guards was killed by a roadside bomb in an unrelated incident on Friday. He died when his vehicle hit an improvised explosive device in the Nahr-e Saraj district of Helmand province.
The prince, 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.
A spokesman for the International Security Assistance Force coalition (Isaf) in Afghanistan said the attack took place 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.”
A number of aircraft, hangars and other buildings at the base were hit and badly damaged by insurgent fire.
Major Martyn Crighton, from Isaf, said: “Nobody would deny that the insurgents are opportunistic. Isaf’s facilities are very safe places, it just so happens that last night insurgents were able to make a spectacle of themselves and cause some damage.
“But there wasn’t any real threat that it was under attack from a large group of insurgents.”
It is understood the militants managed to breach Camp Bastion’s perimeter using rocket-propelled grenades before being driven back by forces inside the camp.
Major Crighton said there was no evidence to suggest whether the attack had been planned in advance or if it was simply opportunistic.
Harry, who celebrated his 28th birthday yesterday, arrived in Afghanistan on 7 September.
He has been undergoing training to fly operations in Apache attack helicopters and is expected to start flying missions this week as a co-pilot gunner.
Camp Bastion is a huge base in the middle of the desert and is shared with US, Estonian, Danish and Afghan troops.
It is the logistics hub for operations in Helmand, with supply convoys and armoured patrols regularly leaving its heavily defended gates, to support the military forward operating bases, patrol bases and checkpoints spread across the province.