Insurgents armed with guns and rockets stormed a heavily fortified air field in Afghanistan, killing two US Marines and damaging aircraft in a major security breach at the camp where Prince Harry is deployed.
The Taliban, which is leading a 10-year insurgency against 117,000 NATO troops in Afghanistan, claimed responsibility for the attack to avenge a US-made film deemed insulting to Islam that has sparked deadly riots across the Middle East.
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 military spokesman Major Adam Wojack.
Another official confirmed that Prince Harry was safe and not affected by the attack.
The attackers managed to penetrate the air field, used by both American and British aircraft, although it was not immediately clear whether they climbed over the wall or blasted their way through with explosives, Wojack said.
They damaged aircraft, but Wojack declined to say what type and how many. He said initial estimates ranged from 15 to 20 insurgents killed, but that it was not yet possible to confirm a final number.
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 numbers or nationalities in line with policy.
Friday's attack is likely to raise serious questions about how insurgents managed to get inside such a massive logistics hub spread over several square kilometres (miles) of desert and home to thousands of soldiers.
It comes against a backdrop of growing concerns about Afghan security 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 allegedly motivated rioters in Libya to kill the US ambassador and three other Americans this week.
"Last night, a number of mujahideen 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.
Prince Harry is deployed at the base as a military helicopter pilot. Taliban insurgents have vowed to kill him, saying earlier this week they had a "high-value plan" to attack the third in line to the British throne.
ISAF said it was assessing the extent of the damage to the camp, but the prince was not thought to have been affected.
"The information we have is that he was not in any danger," said Master Sergeant Bob Barko of ISAF.
Harry, 27, will spend four months based at the base, which according to a June statement by Britain's Ministry of Defence is home to more than 28,000 people.
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 increasing 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.
A total of 327 international troops have been killed in Afghanistan so far this year, according to the iCasualties website, 250 of them American. The toll does not include those who died in the latest attack.