The commandant of the Marine Corps on Monday took the extraordinary step of firing two generals for not adequately protecting a giant base in southern Afghanistan that Taliban fighters stormed last year, resulting in the deaths of two Marines and the destruction of half a dozen U.S. fighter jets.

It is the first time since the Vietnam War that a general, let alone two, has been sacked for negligence after a successful enemy attack. But the assault also was unprecedented: Fifteen insurgents entered a NATO airfield and destroyed almost an entire squadron of Marine AV-8B Harrier jets, the largest single loss of allied materiel in the almost 12-year Afghan war.

British news media reported that Prince Harry, a Harrier jet pilot who was on the base at the time, was a target of the attack. His birthday is Sept. 15, the date of the assault.

The commandant, Gen. James Amos, said the two generals did not deploy enough troops to guard the base and take other measures to prepare for a ground attack by the Taliban.

Unlimited Digital Access. $1 for 4 weeks.

The two, Maj. Gen. Charles Gurganus, the top Marine commander in southern Afghanistan at the time, and Maj. Gen. Gregg Sturdevant, the senior Marine aviation officer in the area, “failed to exercise the level of judgment expected of commanders of their rank,” Amos said.

“It was unrealistic to think that a determined enemy would not be able to penetrate the perimeter fence,” Amos said.

The withdrawal of thousands of U.S. troops over the past two years has forced commanders to triage, sometimes leading them to thin out defenses. The U.S. military also has been forced to rely on other nations’ troops, who often are not as well trained or equipped, to safeguard American personnel and supplies.

The attack occurred at Camp Bastion, a British-run NATO air base in Helmand province that adjoins Camp Leatherneck, a vast U.S. facility that serves as the NATO headquarters for southwestern Afghanistan. Because Leatherneck does not have a runway, the Marines use Bastion as their principal air hub in the country. Several hundred Marines live and work on the British side, and dozens of U.S. helicopters and fixed-wing aircraft are parked there.

The British are responsible for guarding Bastion, which is ringed by a chain-link fence, triple coils of razor wire and watchtowers from which sentries can scan the horizon for any potential attackers.

British commanders had assigned the task of manning the towers to troops from Tonga, which has sent 55 soldiers to Afghanistan.

On the night of the attack, the Tongans left unmanned the nearest watchtower to the point of the Taliban breach, according to an investigation by the U.S. Central Command.

When Gurganus took command in 2011, about 17,000 U.S. troops were in his area of operations. By the time of the attack, in September 2012, the American contingent had dropped to 7,400 because of troop-withdrawal requirements imposed by President Obama.

Amos said Gurganus should have reallocated troops from elsewhere to protect the encampments.

In interviews with The Washington Post this year, Gurganus characterized the attack as “a lucky break” for the Taliban. “When you’re fighting a war, the enemy gets a vote,” he said.

Two Marines, Lt. Col. Christopher Raible and Sgt. Bradley Atwell, were killed trying to fend off the attack. Raible, a Harrier squadron commander, charged into the combat zone armed with only a handgun. Eight other Marines were wounded in the fighting. The cost of the destroyed and damaged aircraft has been estimated at $200 million.

Before the investigation, Amos had nominated Gurganus to receive a third star and serve as the Marine Corps staff director, the service’s third-ranking job. His nomination was placed on hold once the inquiry began.

Since his return from Afghanistan, Sturdevant has been serving as the director of plans and policy for the U.S. Pacific Command.

Gurganus and Sturdevant will be allowed to retire, but Amos said it will be up to Navy Secretary Ray Mabus to determine their final rank. If allowed to retire as major generals, they would be eligible to receive an inflation-adjusted annual pension of about $145,000.

The last two-star general to be fired for combat incompetence was Army Maj. Gen. James Baldwin, who was relieved of command in 1971 after a North Vietnamese attack on a U.S. outpost that killed 30 soldiers, said military historian Thomas E. Ricks.