NEW YORK (AP) — A federal judge has appointed an independent monitor to oversee changes to the New York Police Department's contentious stop-and-frisk policy.

U.S. District Court Judge Shira Scheindlin ruled Monday in the case of four men who say New York City police unfairly targeted them because of their race. There have been about 5 million stops during the past decade, mostly of black and Hispanic men.

Scheindlin ruled after a 10-week bench trial that included testimony from top NYPD brass and a dozen people who said they were wrongly stopped by police.

City lawyers argued the department does a good job policing itself with an internal affairs bureau, a civilian complaint board and quality assurance divisions.