NEW YORK (CBSNewYork/AP) — A federal judge this week threw out a New York City transit system rule that allowed police officers to demand identification documents from anyone riding the subway.

The ruling came following a lawsuit filed by two vintage train aficionados, who were stopped by police while taking photographs at the Broad Channel subway station in Queens.

READ MORE: Long Island Hoping For Best But Bracing For Worst As Nor'easter Approaches: 'Get Prepared Now'

In the Aug. 21, 2010 incident, Steve Barry, the editor of Railfan & Railroad Magazine, and his friend Michael Burkhart, were told by police that taking photographs in the subway system is forbidden – which is not true, according to the New York Civil Liberties Union.

Barry asked the officer to cite the city statute the men were violating, but instead, the officer demanded identification from both men, the NYCLU said. Barry gave his name and address, but did not give the officer any ID.

The officer then arrested both Barry and Burkhart, and held them in the subway station waiting area for about half an hour, the NYCLU said. Both men were handcuffed and searched.

Ultimately, the men received tickets for unauthorized photos, even though photography is actually permitted in the subway system, the NYCLU reported. The tickets were ultimately dismissed.

READ MORE: Remembering NYPD Officer Jason Rivera: Wake Held For 22-Year-Old Killed In Line Of Duty In Harlem

Barry was also ticketed for failing to comply with a Transit Authority rule to carry ID. That ticket was also later thrown out, but Barry and Burkhart were so upset about the situation that they quit coming to New York City to photograph the subway system, the NYCLU said.

U.S. Magistrate Cheryl Pollak ruled Friday that a rule requiring riders to provide any documents requested by police was “unconstitutionally vague” and encouraged “arbitrary and discriminatory enforcement.”

The NYCLU characterized the ruling as a triumph.

“This decision is a victory for the freedom of people to walk around free from showing their papers, a core American right,” NYCLU Staff Attorney Mariko Hirose said in a news release. “It’s past time for the NYPD to learn about the Constitution and stop harassing and even arresting people for exercising their basic rights.”

A spokesman for New York City Transit said the agency was still reviewing the ruling late Friday.

Do you think the judge made the right decision? Please leave your comments below…

MORE NEWS: Health Officials Tracking New 'Stealth' Omicron Variant Spreading In Europe, Detected In U.S.

(TM and © Copyright 2013 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2013 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)