Taliban armed with guns and rockets stormed a heavily fortified airfield in Afghanistan where Prince Harry is deployed, killing two US Marines and attacking aircraft in a major security breach.
The militia, which is leading a 10-year insurgency against 117,000 NATO troops, said it carried out the attack to avenge a US-made film deemed insulting to Islam that has sparked deadly riots across the Middle East and North Africa.
The attack on Camp Bastion in southern Helmand province, one of the toughest battlegrounds of the war, started at 10:15 pm (1745 GMT) on Friday and the base was cleared on Saturday morning, said US Army Major Adam Wojack.
Prince Harry was safe and not affected by the attack, another official confirmed. Although the Taliban have vowed to kill the third in line to the British throne, one of its spokesmen told AFP that the assault "had nothing to do with the prince".
General Sayed Malook, the head of the Afghan army in the south, said a suicide bomber on foot blew himself up, blasting a hole in the perimeter wall, allowing 16 insurgents to storm inside armed with guns and rocket-propelled grenades.
"As soon as they entered the base, fighting started. Afghan forces were not involved, they only helped to extinguish the fire," Malook told AFP.
A fuel reservoir and an aircraft hangar were set ablaze during the attack and it took until dawn to extinguish the fire, he said.
Wojack said it was not immediately clear how the attackers had managed to penetrate the air field, which is used by both American and British aircraft, but confirmed that aircraft had been damaged.
According to initial estimates, 15 to 20 insurgents were killed, he said.
A defence official in Washington said two US Marines were killed, and NATO's US-led International Security Assistance Force said some personnel were wounded, but gave no details, in line with policy.
The brazen attack is likely to renew serious questions about how insurgents managed to penetrate such a massive logistics hub in the desert, which in June Britain said was home to 28,000 soldiers.
In March, an Afghan man died after trying to ram a truck into US Marines waiting on the tarmac to greet US Secretary of Defense Leon Panetta as he flew into Camp Bastion.
It was not immediately clear whether insurgents had had any inside assistance.
There are growing concerns about Afghan personnel opening fire on their NATO colleagues, killing 45 Western soldiers so far this year, the majority of them American.
A Taliban spokesman claimed the attack was waged to avenge a low-budget American YouTube film, "Innocence of Muslims", which has incited a furious wave of deadly anti-American violence in Yemen, Libya and Sudan, and protests in many other countries.
"A number of mujahedeen fighters have carried out suicide attacks on Camp Bastion of Helmand in revenge for the insulting movie by the Americans," spokesman Qari Yousuf Ahmadi told AFP by telephone.
The Taliban this week vowed to kill Prince Harry, who is deployed at the base as an Apache helicopter pilot and who celebrates his 28th birthday on Saturday.
ISAF said it was assessing the extent of the damage to the camp, but the prince was not affected.
"He was not in any danger," said Master Sergeant Bob Barko of ISAF.
Harry will spend four months based at the base.
In 2008, he was hastily withdrawn from Afghanistan when a news blackout surrounding his deployment, on the ground directing aircraft in attacks on Taliban positions, was broken.
This time, however, the government has released images of him in Afghanistan from the start, saying that any risk "has been, and will continue to be, assessed".
The Taliban have stepped up attacks as NATO hands responsibility to Afghan forces and accelerates a phased withdrawal that will see most Western troops leave the country by the end of 2014.
Helmand was the focus of a 30,000-strong troop surge announced by the United States in 2009 designed to reverse the Taliban insurgency.
More than 327 Western troops have been killed in Afghanistan so far this year, according to the iCasualties website, 250 of them American.