The Air Force has removed the commander of a nuclear weapons unit at a Montana base following 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 said the decision to relieve Col. David Lynch of command at Malmstrom Air Force Base stems from a loss of confidence. They said it is not the result of the failed inspection earlier this month first reported on Aug. 13.

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

This is the second time in recent months that an Air Force nuclear commander was replaced following a high-profile security problem.

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

The 341st Security Forces Group, which Lynch had led since June 2012, has more than 1,200 people 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, Air Force Global Strike Command Security Forces Division director, will take over on an interim basis.

Base commander Col. Robert Stanley was not available for comment.