U.S. Army weapons officials have figured out the cause and ginned up a fix for a dangerous glitch in the selector switch of M4 and M4A1 carbines that could cause the weapon to fire unintentionally.

In June, Military.com reported that about 3,000 Army M4 and M4A1s had failed new safety inspections begun after the service's Tank-automotive and Armaments Command sent out a safety-of-use message in March to all branches of the U.S. military, advising units to perform an updated functions check on all variants of M16s and M4s after a soldier experienced an unexplained, unintended discharge.

After more than 50,000 weapons were checked, TACOM officials discovered the cause of the glitch and halted the inspections, TACOM spokesman R. Slade Walters told Military.com.

"After receiving a significant number of reports from the field and an average failure rate of about 6 percent of the weapons inspected, we ended the inspections and have determined that the cause of the problem is a tolerance stack of the internal firing components," he said in an email. "The problem is fixed by modifying the selector to remove the tolerance issue and the fault. TACOM is working on an Army-wide directive to repair weapons with the issue that will be released when it is approved at the appropriate levels."

During a follow-up phone interview, Walters said, "Each individual part conforms to the tolerance requirements, but when the multiple parts get stuck together in 6 to 9 percent of the weapons, depending on which models you are looking at ... those tolerances create that condition."

"So in some weapons it's not a problem and in others it is," he said, explaining that the lower receiver's internal parts need "some machining and or grinding to slightly modify the internal components."

"When they do that, it fixes the problem ... and when they have done it and repeated it, they have been able to correct the problem in weapons showing the issue," he added.

Most failures occurred in M4A1s. The M4A1s that had been converted from M4s suffered 2,070 failures out of 23,000 inspected, a 9 percent failure rate. Out of about 16,000 original M4A1s inspected, 960 suffered failures, a 6 percent failure rate.

Less than one percent of the 4,000 M4s checked failed the updated functions check. And less than one percent of the 8,500 M16A2s checked failed the test as well.

About 500 M16A4s were also checked, but no failures were reported.

The Marine Corps also uses the M4 carbine, but the service said in June that its weapons were passing the new functions check.

The glitch-testing started when a Fort Knox soldier's M4A1 selector switch became stuck in-between the semi and auto settings. When the soldier pulled the trigger, the weapon failed to fire. The soldier then moved the selector switch and the weapon fired, the TACOM message states.

The M4A1 is now the Army's primary individual weapon. The service is converting M4 carbines to M4A1s through the M4 Product Improvement program. The M4A1 has been used by special operations forces for about two decades. It features a heavier barrel and a full-automatic setting instead of the three-round burst setting on standard M4s.

The Army said that all new M4A1s being issued are being checked for the selector glitch and corrected as needed, Walters said.

"Anybody who has gotten a new weapon in the last month or two has gotten weapons free of this error," he said. "It's not a small number; it's like several thousand. It has already been implemented in the supply chain."

It's unclear if TACOM will have unit armorers fix the weapons that showed the glitch or if TACOM technicians will do the work, Walters said. He added that "this is still pre-decisional."

TACOM officials also could not explain why the glitch had not shown up in the past.

"It was just a weird fluke," Walters said. "In the number of rounds that have gone through those models in the number of years those models have been available, it's like a winning-the-lottery kind of fluke. And the fact that we discovered it is just one of those things."

-- Matthew Cox can be reached at matthew.cox@military.com.