(CNN) -- The New York Police Department's controversial stop-and-frisk policy violates constitutional rights and must be altered, a federal judge ruled Monday.
Judge Shira A. Scheindlin's ruling stems from a class-action lawsuit claiming that the city's police officers routinely stopped minority men, particularly blacks and Latinos, without legal reasons.
Scheindlin said that an outside monitor will be appointed to oversee changes to the policy.
The police department had said that the policy -- in which police stop, question and frisk people they considered suspicious -- is used to deter crime. The practice is widely criticized.
The lead plaintiff in the case is David Floyd, a medical student who was stopped twice, once in the middle of the afternoon when he was in front of his home in the Bronx, according to the suit, which was filed in 2008.
The trial, which ended in May, featured nine weeks of testimony, including from men who say police stopped them for no reason and from police officers who say quotas forced them to make unnecessary stops.
Closing arguments gave conflicting accounts of stop-and-frisk incidents. While attorneys for the city argued that one man was stopped because he appeared to be smoking marijuana, the plaintiffs' attorneys argued that he was simply talking on a cell phone.
Another man was reportedly stopped because he fit the description of a wanted man in a high-crime area with a recent string of burglaries, but the plaintiffs' attorneys argued that he was more than a mile from where the burglaries occurred and that the last burglary in that area occurred more than 25 days earlier.
According to the New York Civil Liberties Union, the police department logged its 5 millionth stop-and-frisk under Mayor Michael Bloomberg in March.
™ & © 2013 Cable News Network, Inc., a Time Warner Company. All rights reserved.