A Metro train departs Gallery Place-Chinatown Station. (Alex Brandon/AP)

Metro abruptly pulled all of its 4000-series rail cars from service Thursday after discovering a glitch that poses a collision risk, the transit agency said.

General Manager Paul J. Wiedefeld ordered the cars immediately be taken out of service after engineers warned safety officials of the problem, which could leave trains traveling faster than they’re supposed to.

Eighty-two cars were to be removed while Metro investigates the problem, which centers on automatic train control (ATC), a system that is supposed to act as a safeguard against crashes.

ATC assigns “speed commands” to keep trains at a safe distance from one another, according to Metro. When a train is not authorized to move, the operator receives what is called a “zero speed command,” which shows up as a double-zero on the train’s control panel. Metro said there is a slight risk that 4000-series cars could receive an improper speed command when in the “lead position” — or front of a train — posing a crash risk.

“Today’s action is being taken in an abundance of caution and, while we believe that the risk is small, it is a risk I am unwilling to take,” Wiedefeld said in a statement. “Everything we do here is going to put safety first, no matter what.”

Metro said it does not conduct the manufacturer-recommended annual testing that would eliminate the risk of a false command.

Thursday’s action was the latest chapter in the troubled history of the 4000-series, manufactured by Breda in 1991. The series is the system’s most problematic and is prone to persistent breakdowns. The 100-car fleet was pulled from service last year following reports that doors were opening mid-ride. Metro was considering retiring the fleet by the end of 2017, following the scrapping of the system’s oldest 1000-series rail cars.

Thursday’s discovery will likely speed up that process.

“We are looking at ways to potentially accelerate the retirement of 4Ks,” Metro spokesman Dan Stessel said in an email. But, he said, the retirement of the 1000-series cars, mandated by the National Transportation Safety Board after the 2009 Red Line crash at Fort Totten that killed nine, remains the priority.

By 3:30 p.m. Thursday, Metro had begun taking the 4000-series cars out of service.

Metro plans to eventually replace more than half of its entire fleet with 7000-series cars, the system’s newest model, manufactured by Kawasaki.

While the 4000s are out of commission, the agency said, riders may notice fewer eight-car trains across the system, which could create crowding.

The 82 4000-series cars represent about 7 percent of Metro’s 1,212-car passenger fleet. Metro said that no specific incident prompted their removal, but the agency has never performed the technical tests needed to mitigate the crash risk, and doesn’t have the equipment to do so.

When the 4000s are floated back into service, the agency said it will turn to a solution devised for the 1000-series cars: sandwich them in the middle of newer, more reliable cars to eliminate the risk.

The Metro board chairman, Jack Evans, said the problem, though unfortunate, demonstrates that Metro is doing a better job of quickly diagnosing potential hazards and making decisions to prioritize safety. He said Metro’s staff — rather than federal inspectors or NTSB investigators — discovered the problem and brought it to the attention of agency leadership.

“The good news is we found it,” Evans said. “As silly as that sounds, it’s a big deal that Metro actually found a problem on our own and are correcting it. . . . It shows that the increased emphasis on safety has, in this case, paid off.”

And Evans noted that there’s no love lost for the perpetually problematic 4000-series cars.

“The 4000-series cars are unreliable cars anyway, so maybe getting them all off of the tracks — even with fewer cars in the system — maybe that’s a good thing if we have fewer cars breaking down.”

Carol Carmody, chairman of the Metro board’s safety committee, lauded Wiedefeld’s quick thinking.

“Paul’s actions are right on target,” she said. “I’m sure this is disruptive, and you never like to hear these things, but it sounds like this decision was the right thing to do.”