A Manhattan federal judge said a transgender Occupy Wall Street protester may sue New York City for treating him differently from other male protesters following their arrests on the Brooklyn Bridge.

The decision made public on Monday is also notable because U.S. District Judge Jed Rakoff saidtransgender people, like gay people, are a "quasi-suspect" class requiring judges to more closely scrutinize alleged discrimination against them.

Justin Adkins, 37, an assistant director of the Davis Center at Williams College in Williamstown, Massachusetts, said police at first held him with other men in a cell at the 90th precinct in Brooklyn's Williamsburg section after their Oct. 1, 2011 arrests.

RELATED: PHOTOS: Looking back at Occupy Wall Street

But when police learned Adkins was transgender, they moved him to a chair next to a bathroom, denied him food while others got sandwiches, and handcuffed him for seven hours to a metal handrail, causing arm and shoulder soreness, the complaint said.

Rakoff said Adkins could pursue a claim over this treatment that the city violated his equal protection rights under the U.S. Constitution's 14th Amendment.

The judge said transgender people were "similarly situated" to gay people in that they have long suffered persecution, were a "discrete minority" and were "politically powerless," and because their status bore no relation to their ability to contribute to society.

As a result, he said Adkins could prevail if his treatment was not "substantially related to an important government interest."

PHOTOS: Occupy Wall Street celebrates fourth anniversary

Rakoff said the complaint alleged as much, rejecting the city's argument that it moved Adkins to insure his safety, and that it acted rationally.

"Defendants cannot argue their actions were substantially related to ensuring plaintiff's safety when they removed him from an allegedly safe place and caused him injury, albeit minimal injury, by handcuffing him to a wall next to the sole bathroom in the precinct," he wrote.

Rakoff relied heavily on a 2012 appellate ruling in favor of Edith Windsor, who challenged a law limiting various federal benefits to people in heterosexual unions. The U.S. Supreme Court upheld that ruling the next year.

Nick Paolucci, a spokesman for the city's law department, said that office was reviewing Rakoff's decision.

Andrea Ritchie, a lawyer for Adkins, said in a telephone interview, "The judge made the right decision. It's a huge victory for transgender people to receive recognition that heightened scrutiny should apply in cases of discrimination by the police."

The case is Adkins v City of New York et al, U.S. District Court, Southern District of New York, No. 14-07519.