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