The Rev. Al Sharpton, center, walks with demonstrators June 17, 2012, during a silent march to end the "stop-and-frisk" program in New York. (Seth Wenig/AP)

A federal judge in New York has ruled New York City's controversial "stop and frisk" law unconstitutional, saying it is a "form of racial profiling."

The judge noted that the policy, which allows officers to briefly detain a person if they have reasonable suspicion that the person is in the process of committing or is about to commit a crime, goes too far. It also permits pat downs if the officer feels he or she is in danger.

The judge, Shira A. Scheindlin, noted that African Americans and Hispanics are the target of the vast majority of these detentions — higher than the rate at which they are responsible for crime.

"While a person’s race may be important if it fits the description of a particular crime suspect, it is impermissible to subject all members of a racially defined group to heightened police enforcement because some members of that group are criminals," Scheindlin wrote. "The Equal Protection Clause does not permit race-based suspicion."

Scheindlin has appointed a third party to review the policy and make necessary changes.

She is also calling for "an immediate change to certain policies and activities of the NYPD, a trial program requiring the use of body-worn cameras in one precinct per borough (and) a community-based joint remedial process to be conducted by a court-appointed facilitator."

New York Mayor Michael Bloomberg has been a chief supporter of the "stop and frisk" policy, but privacy activists and minority groups have decried the practice.

Bloomberg has argued that the law has led to a significant reduction in crime, but Scheindlin said that is irrelevant when it comes to the law's constitutionality.

Updated at 11:59 a.m.