Prince Harry should not be withdrawn from his military role in Afghanistan despite an attack on the Camp Bastion military compound, defence experts have said.

The Taliban claimed responsibility for Friday night's attack, saying it was carried out because Harry was on the base, and also as revenge for an anti-Islamic film.

The Prince was unharmed, but two US Marines were killed and several more wounded.

Harry, an Army captain, is based at Camp Bastion for his second tour of duty, due to last four months. The Prince 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.

The full scale of the Taliban attack on Camp Bastion later became clear as it emerged that 15 insurgents wearing US Army uniforms destroyed six Harrier jets, three refuelling stations and damaged a number of aircraft hangars.

Qari Yousef Ahmadi, a spokesman for the Taliban, told The Associated Press: "We attacked that base because Prince Harry was also on it and so they can know our anger." He added: "Thousands more suicide attackers are ready to give up their lives for the sake of the Prophet."

Tory MP Colonel Bob Stewart, a former commander of British troops in Bosnia, said he did not think the Prince should be pulled out of Afghanistan because of the attack by the Taliban. "To hell with them," he said. "Harry wants to go there and our soldiers want him there. He should stay." But Col Stewart added: "Capturing, killing or hurting Prince Harry would be a huge propaganda coup for the Taliban."

A Ministry of Defence spokesman said: "The threat to all our service personnel is continually assessed and all measures taken to mitigate it. As we stated last week, the deployment of Captain Wales has been long planned and the threat to him and others around him thoroughly assessed. We stated that any risk posed by his deployment, based on the capability, opportunity and intent of the insurgency, is continually reviewed."

Harry, who celebrated his 28th birthday on Saturday, arrived in Afghanistan on September 7. 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.