Five men filed a class-action lawsuit earlier this month claiming the San Jose Police Department unfairly targeted them for being gay during sting operations in 2014 and 2015.

The men, who are represented by LGBTQ rights attorney Bruce Nickerson, allege that undercover police officers solicited them for sex outside a public park bathroom, believed to be a sexual meet-up spot for gay men. The men claim that they were arrested even if they refused the undercover cops’ advances, on charges of loitering around a toilet. Police said they instigated the undercover stings in response to citizen complaints of lewd conduct in the park.

A judge, however, found the sting operations to be discriminatory last year and dismissed the lewd conduct charges against six men, including the five involved in the lawsuit. Now the men are seeking $1 million in damages.

“The claim that this investigative focus was driven by complaints is minimally supported by the evidence presented, especially as it relates to the park,” Judge Jose Franco ruled at the time, noting that police had received only one documented citizen complaint. “Unpopular groups have too often been made to bear the brunt of discriminatory prosecution or selective enforcement.”

The City of San Jose did not respond to requests for comment by press time.

Daniel Bufano, one of the plaintiffs, claims in the suit that an undercover police officer asked him to engage in oral sex in the bathroom. When Bufano declined, two other undercover officers allegedly forcibly searched him. They berated him for being gay, according to the suit, told him he was a terrible person, and warned him against returning the the park. He says he was then arrested for loitering around a toilet.

John Ferguson, another plaintiff, says he was arrested while trying to leave the bathroom after flirting with an undercover cop. Ferguson tried leaving the bathroom because he did not want “to engage in sexual conduct” there, according to the suit, but the officer allegedly blocked him from leaving. Another officer then appeared and arrested him.

San Jose police told the Mercury News that they ended the sting operations two years ago after they were first objected to in court.