The Federal Trade Commission (FTC) has banned Rite Aid from using facial recognition technology in its stores for five years after the pharmacy chain was found to have falsely accused customers of crimes and unfairly targeted people of color.

Under the terms of a settlement announced Dec. 19, Rite Aid will be barred from using facial recognition technology for surveillance purposes. According to the FTC’s 54-page complaint, from October 2012 to July 2020, Rite Aid employees acting on false alerts followed customers around stores, searched them, ordered some to leave and, if they refused, called the police to confront or remove them, at times in front of friends and family.

Samuel Levine, the director of the FTC’s Bureau of Consumer Protection, said in a statement that “Rite Aid’s reckless use of facial surveillance systems left its customers facing humiliation and other harms.”

Rite Aid’s actions disproportionately affected people of color, especially Black people, Asians and Latinos, all in the name of keeping “persons of interest” out of hundreds of Rite Aid stores in cities including New York, Philadelphia and Sacramento, the F.T.C. said.

The complaint states that Rite Aid used the surveillance systems in urban areas and along public transportation routes, leading to a disproportionate effect on people of color. Also, Rite Aid is said to have trained security workers in its stores to feed images into an “enrollment database” of people it considered “persons of interest,” and employees were told to “push for as many enrollments as possible.” The databases were filled with low-quality images, many of which were obtained from video surveillance cameras, mobile phone cameras and media reports, the F.T.C. said.

That faulty system, officials said, caused thousands of “false-positive matches,” or alerts that incorrectly indicated that a customer was a “match” for a person in Rite Aid’s database. Worse, Rite Aid had no way of tracking false positives, the complaint said.

“Rite Aid’s failure to appropriately train or oversee employees who operated facial recognition technology further increased the likelihood of harm to consumers,” the F.T.C. said.

Rite Aid released a statement denying the allegations that it misused the technology.

“We respect the FTC’s inquiry and are aligned with the agency’s mission to protect consumer privacy. However, we fundamentally disagree with the facial recognition allegations in the agency’s complaint,” the company said. “The allegations relate to a facial recognition technology pilot program the company deployed in a limited number of stores. Rite Aid stopped using the technology in this small group of stores more than three years ago, before the FTC’s investigation regarding the Company’s use of the technology began.”

The settlement with Rite Aid comes about two months after the company filed for bankruptcy protection and announced plans to close 154 stores in more than 10 states.