WASHINGTON — In a rare move, the top Marine on Monday forced two generals into retirement after concluding they should be held to account for failing to secure a base in Afghanistan against a Taliban attack that killed two Marines.

Gen. James Amos, the commandant of the Marine Corps, said in announcing his decision that Maj. Gen. Charles M. Gurganus and Maj. Gen. Gregg A. Sturdevant “did not take adequate force-protection measures” at Camp Bastion, an airfield in southwestern Afghanistan that was the Taliban target.

The Sept. 14, 2012, attack by 15 Taliban fighters caught the Marines by surprise and resulted in the deaths of Lt. Col. Christopher K. Raible, 40, and Sgt. Bradley W. Atwell, 27. The Taliban destroyed six Marine Harrier fighter jets valued at $200 million and badly damaged others.

Gurganus, who was the top American commander in that region of Afghanistan at the time, did not order a formal investigation after the attack. In June, Amos asked U.S. Central Command to investigate, and he said he decided to take action against the two generals after reviewing the results of that investigation. “While I am mindful of the degree of difficulty the Marines in Afghanistan faced in accomplishing a demanding combat mission with a rapidly declining force, my duty requires me to remain true to the timeless axioms related to command responsibility and accountability,” Amos said.