Prince Harry was unharmed after an attack on the Camp Bastion military compound in Afghanistan in which two US Marines were killed and several more wounded.
A Taliban commander told Sky News that Harry - based at the compound in Helmand province in the south of Afghanistan for his second tour of duty - was the primary target of the attack.
US officials said the attack on Friday night 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, an Army captain, 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 occurred near an airfield on the north-east side of the base, which houses American forces in Camp Leatherneck. A number of aircraft, hangars and other buildings at the base were hit and badly damaged by insurgent fire.
An Isaf spokesman in Afghanistan said: "I can confirm there was an attack involving small arms fire." The official added: "The attack is long over and now UK and US forces are in the process of conducting an assessment to discover the extent of the damage and go through the camp to make sure everything is secure."
A Ministry of Defence spokesman in London said: "We are aware of an incident that has taken place at Camp Bastion, which is currently being dealt with."
Price Harry, who is celebrating his 28th birthday, arrived in Afghanistan last Friday. 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.