A federal judge ruled Monday that the New York Police Department violated the civil rights of tens of thousands of New Yorkers with its use of the so-called ‘stop and frisk’ policy.

Judge Shira Schiendlin called for an independent monitor to oversee changes to the contentious policy. The judge found NYPD had used the tactic 4.4 million times between 2004 and 2012, with 80 percent of those stopped being black or Latino.

“The city’s highest officials have turned a blind eye to the evidence that officers are conducting stops in a racially discriminatory manner,” she wrote. “In their zeal to defend a policy that they believe to be effective, they have willfully ignored overwhelming proof that the policy of targeting ‘the right people’ is racially discriminatory and therefore violates the United States Constitution.”

New York Mayor Michael Bloomberg said at a news conference the city would appeal, and accused the judge of ignoring “the real-world realities of crime.”

NYPD Commissioner Ray Kelly said it is “recklessly untrue” that the police department racially profiles.

“Race is never the reason for a stop,” Kelly said.

Bloomberg has defended the practice in the past and recently said blacks and Latinos aren’t stopped enough. He stirred up controversy in June after saying the appropriate comparison of NYPD stops isn’t to the city’s population but rather to the suspects’ descriptions.

RELATED: Stop and frisk trial shines a light into NYPD practices

“One newspaper and one news service, they just keep saying, ‘Oh, it’s a disproportionate percentage of a particular ethnic group.’ That may be. But it’s not a disproportionate percentage of those who witnesses and victims describe as committing the murders. In that case, incidentally, I think we disproportionately stop whites too much and minorities too little,” he said on a local news radio show in June.

Judge Schiendlin wrote in her decision that she was not ruling on the effectiveness of ‘stop and frisk’ but instead its constitutionality.

“The city and its highest officials believe that blacks and Hispanics should be stopped at the same rate as their proportion of the local criminal suspect population. But this reasoning is flawed because the stopped population is overwhelmingly innocent – not criminal,” she wrote. ““Many police practices may be useful for fighting crime — preventive detention or coerced confessions, for example, but because they are unconstitutional they cannot be used, no matter how effective.”

Four men sued the NYPD in 2004, saying they were unfairly targeted because they were minorities.

RELATED: Opinion: When Stop and Frisk taught me I was a menace to society

Under the controversial tactic, thousands of Latinos have been stopped and questioned by police. According to data from the New York Civil Liberties Union (NYCLU), in 2012, 532,911 New Yorkers were subjected to “stop and frisk.” 89 percent of those stops led to no further action. 32 percent of those stopped by NYPD under the policy were Latinos.

Roberto Concepción, Associate Counsel with civil rights organization LatinoJustice PRLDEF, said that today’s ruling spoke to the experience of many Latinos and New Yorkers.

“Today’s court ruling confirmed the reality of many New Yorkers mostly black and Latinos,” he says. “The court has invited stakeholders to the table, including members of the community, police, religious leaders, activists — all done in the name of making sure the reforms that are required of the NYPD actually are effective.”

The NYCLU also praised the ruling.

“We welcome the appointment of a federal monitor to oversee the much-needed reform of NYPD stop-and-frisk practices and we look forward [to] the broad process of community engagement that the court has ordered to formulate fundamental reforms of stop-and-frisk,” NYCLU Executive Director Donna Lieberman said in a statement. “With this step, the victims of this illegal and biased program have become central players in cleaning up the program.”

Today’s opinion by Judge Schiendlin also covers the enforcement of Operation Clean Halls, a program under the ‘stop and frisk’ umbrella that allows police to patrol in private apartment buildings. Concepción, one of the attorneys who worked on this second case, hopes the decision will help to rebuild the community’s trust in the police force and wants reforms to be something “the community believes in.”

Peter L. Zimroth, the city’s former lead attorney and previously a chief assistant district attorney, was appointed as the independent monitor to oversee changes to the policy. Mayor Bloomberg and NYPD Commissioner Ray Kelly are set to have a press conference later this afternoon to respond to the ruling.