A San Diego judge ruled Tuesday that prosecutors in a gay rights case violated the defendants’ rights when they dismissed a potential juror because he’s gay.

Superior Court Judge Joan Weber said defendants in the case, which involved a same-sex marriage protest, were denied a representative jury. Weber called the city attorney office’s actions “shocking” and dismissed the entire jury panel selected for the case, reported UT San Diego.

The case stems from the arrest of nine people for protesting at the city clerk’s office over Proposition 8, California's same-sex marriage ban. The protesters had demanded marriage licenses.

Prosecutors said that the potential juror was unsuitable because he’d protested in support of gay rights issues in the past.

But attorneys for the accused activists said prosecutors systematically excluded gay people from the jury, violating their client's right to a jury of peers. They objected after the prosecution challenged the selection of two potential jurors, both of whom had identified themselves as gay.

“There has been a fundamental violation of a constitutional right to a jury trial by my client’s peers,” said Todd Moore, who represents one of the defendants.

Weber’s ruling means that prosecutors now have to pick a new jury. But she urged the prosecution to consider reducing the charges to infractions.

“I’ve never had so many jurors express concerns about why a prosecutor’s office would move forward and spend time and money on a case of this nature,” Weber said.