The Air Force has removed the commander of a nuclear weapons unit at a Montana base after a failed safety and security inspection that marked the second major misstep this year for one of the military’s most sensitive missions.

Military leaders say the decision to relieve Col. David Lynch of command at Malmstrom Air Force Base stems from a loss of confidence. They say it was not the result of the failed inspection this month, first reported by the Associated Press on Aug. 13.

Lynch will retire, a base spokesman, Sgt. Robert Biermann, said Sunday. Lynch’s command included the 341st Missile Wing, which operates a land-based nuclear force of 450 Minuteman III intercontinental ballistic missiles. The unit failed a review of its adherence to rules that ensure the safety, security and control of its nuclear weapons.

It is the second time in recent months that an Air Force nuclear commander has been removed after a high-profile security problem.

Lt. Col. Randy Olson was relieved of duty at Minot Air Force Base, N.D., in June. The AP first reported an unprecedented sidelining of 17 launch officers there in May after an exceptionally poor review in the spring.

The 341st Security Forces Group, which Lynch had led since June 2012, has more than 1,200 personnel and four squadrons. It provides security for the 341st Missile Wing, 15 launch control centers and 150 nuclear missile silos in a huge area of central Montana.

The decision to remove Lynch was announced in a statement Friday. There is no timeline for selecting his replacement. Col. John Wilcox, director of the Air Force Global Strike Command Security Forces Division, will take over on an interim basis.