(CNN) -- A federal judge ordered Monday that the New York Police Department's controversial stop-and-frisk policy be altered, finding that it violates the Constitution in part by unlawfully targeting blacks and Latinos.
But city officials bristled at the contention that police racially profile suspects, and vowed to appeal the ruling, contending the policy has cut crime.
"You're not going to see a change in tactics overnight," Mayor Michael Bloomberg told reporters Monday, saying it would take time to implement the judge's changes even if an appellate court doesn't temporarily halt it.
Asked if he hopes an appeal will delay the order until he leaves office next year, Bloomberg said: "Boy, I hope so, because I wouldn't want to be responsible for a lot of people dying."
Judge Shira A. Scheindlin, ruling on a class-action lawsuit, wrote that the policy violated plaintiffs' Fourth Amendment rights barring unreasonable searches, finding that police made at least 200,000 stops from 2004 to June 2012 without reasonable suspicion.
She also found evidence of racial profiling, violating plaintiffs' 14th Amendment rights guaranteeing equal protection.
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 city's highest officials have turned a blind eye to the evidence that officers are conducting stops in a racially discriminatory manner," Scheindlin 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."
Coupling Monday's ruling with a similar decision in January, she ordered that the policy be altered so that stops are based on reasonable suspicion and in a racially neutral manner.
Among her orders:
-- She appointed Peter Zimroth, a former chief assistant district attorney in Manhattan, to develop and oversee near-term reforms, including changes to the NYPD's policies and training.
-- In a pilot project, NYPD patrol officers in five precincts -- one per borough -- must wear video cameras. The chosen precincts would be those with the most stops in 2012. "The recordings should ... alleviate some of the mistrust that has developed between the police and the black and Hispanic communities," and "will be equally helpful to members of NYPD who are wrongly accused of inappropriate behavior," Scheindlin wrote.
-- Other, longer-term reforms would come after community input.
The lawsuit, filed in 2008, went to trial for nine weeks this spring. The lead plaintiff in the case was 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.
Another plaintiff, Leroy Downs, described to CNN how he, too, was confronted and frisked as he sat on the steps in front of his own home.
"The officers drove past me, went up the street, reversed, came back, jumped out and they approached me," Downs said, adding that the officers told him, "You look like you (were) smoking weed."
Downs said he told the officers, "Come on, I'm talking on a cell phone."
"They cursed at me and said, 'Get against the fence,' and started pushing me toward the fence and commenced to searching me," added Downs. Police found nothing on Downs.
"I've been so much of this throughout my life, that's one of the reasons why I took part in this -- I just want it to stop," Downs said.
David Ourlicht, also among those stopped, reacted to the judge's ruling with tears and with an assessment: "This is a big thing for New York, but as far as for America as a whole, it shows the polarization of people of color in this country, as how we're viewed."
In her ruling, Scheindlin said more than 80% of the stops involved blacks or Hispanics. The NYPD made more than 4.4 million total stops under the policy from 2004 to June 2012.
She wrote that the NYPD carried out more stops where there were more black and Hispanic residents, at a rate disproportionate with crime rates. She also wrote that the department has an unwritten policy of targeting "the right people" for stops -- encouraging, in practice, the targeting of young blacks and Hispanics based on their prevalence in local crime complaints.
"No one should live in fear of being stopped whenever he leaves his home to go about the activities of daily life," she wrote. "Those who are routinely subjected to stops are overwhelmingly people of color, and they are justifiably troubled to be singled out when many of them have done nothing to attract the unwanted attention."
The city will ask the 2nd Circuit Court of Appeals to block the ruling until an appeal is heard, city attorney Michael Cardozo said Monday.
The ruling hardly impressed Bloomberg and New York Police Commissioner Ray Kelly, who called Scheindlin's finding of racial profiling "disturbing and offensive."
"We do not engage in racial profiling. It is prohibited by law," Kelly said. "We train our officers that they need reasonable suspicion to make a stop, and I can assure you that race is never a reason to conduct a stop."
The policy "is certainly a tool that every police officer needs throughout America," Kelly said.
"If you see something suspicious, you pay your police officers to ask a question, stop to inquire. To the extent that this significantly impacts on that, I think you're going to have a problem, not only here, but across America."
Bloomberg said the policy was one of a number of programs that helped the city's murder rate drop -- it's 50% below the rate when he took office nearly 12 years ago, he said.
The mayor said "we want to match the stops to where the reports of crime are."
"One of the problems we have in our society today is that victims and perpetrators of crime are (disproportionately) young minority men -- that's just a fact," he said. "If there's any administration that's ever worked hard on that, I think it's ours ... we're trying to do something about it.
"That has nothing to do with, however, where we stop people. We go to where the reports of crime are. Those unfortunately happen to be poor neighborhoods and minority neighborhoods. But that's not the original objective or the intent or how we get there. We get there when there's a crime reported, and we will continue to do that."
The trial, which ended in May, included testimony from men who said 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.
CNN's Sunny Hostin, Michael Tabb, Rose Arce and Marina Carver contributed to this report.