At the same time, tensions with the government flared Sunday as President Hamid Karzai condemned the deaths of Afghan women in airstrikes and criticized the continued American custody of hundreds of Afghan prisoners.

The military investigation into the attack at Bastion is now trying to uncover whether the insurgents had help from inside the camp and whether they were trained or aided by neighboring countries, such as Pakistan or Iran, which have allowed the Taliban to take refuge on their territory. But military officials and Afghan analysts said that the insurgents may well have prepared for their mission in significant measure by studying easily available satellite images on the Internet. “We don’t underestimate the enemy,” the military official said, speaking on the condition of anonymity because of the continuing investigation. “We know the enemy has limited capability to do these, but they are not a whole bunch of yokels running around the country.”

The 15 insurgents conducting the attack lost no time from the moment they blew a hole in the perimeter at one of the closest points to the airfield, military officials said. They then raced toward their targets, shooting and setting fire to parked Marine AV-8B Harrier jets and destroying three refueling stations, even as a quick reaction force was mustering to fight them off, a military official said. “It was a running gun battle for a while, two and a half hours, nonetheless they were able to get to the aircraft before we could intercept them,” a military official said, noting that because it happened at night it was difficult until daylight to be sure that all the insurgents had been killed or captured. All but one was killed; the remaining insurgent is in custody, the military said.

Two American Marines were killed in the attack, and nine coalition personnel, including a civilian contractor, were wounded, the military said in a statement. Prince Harry, the third in line to the British throne, is doing a tour of duty as a helicopter pilot and was stationed at Camp Bastion at the time of the attack, but was not hurt. Camp Bastion is home mostly to British soldiers, while the neighboring camp, known as Leatherneck, has American Marines and other service members.

Six of the jets, which each cost between $23 million and $30 million when they were first acquired by the United States Navy, according to a General Accounting Office report, were completely destroyed and two more were so severely damaged it was unlikely they could be repaired. Also badly damaged were three refueling stations and three soft-skinned aircraft hangars, the military said in a news release.