SAN FRANCISCO (CN) – A federal judge refused Tuesday to dismiss a lawsuit claiming the FBI used an unconstitutional subpoena to spy on anonymous supporters of jailed journalist Barrett Brown.

U.S. Magistrate Judge Maria-Elena James found the lawsuit plausibly alleged that the government abused its subpoena power to unmask the identities of unnamed donors who raised money for Brown’s legal defense.

“Defendants have failed to articulate any facially reasonable explanation for requesting donors’ identities,” James wrote in her 26-page ruling.

Brown was arrested in September 2012 and sentenced to five years and three months in prison after he shared an online link to files stolen in the 2011 hack of the security and intelligence contractor Strategic Forecasting, or Stratfor.

Kevin Gallagher, who started an online fundraiser for Brown’s legal defense, and an anonymous donor filed a class action against the government in February this year. They claim the FBI violated donors’ privacy, the First Amendment, and the Stored Communications Act.

Gallagher and Donor No. 1 claim Dallas-based FBI agent Robert Smith and Candina Heath, an assistant U.S. attorney in Texas, used a subpoena to “unlawfully identify, target and surveil” anonymous supporters of Brown.

The government says those donors have no expectation of privacy for transaction records retained by a third party. But the plaintiffs say the records were protected political speech and that revealing their identities violates their rights to engage in anonymous political speech.

James declined to analyze the online payment service provider WePay’s privacy policy at this stage in the litigation, saying issues of disputed fact would be resolved on summary judgment or at trial.

The subpoena was reportedly issued to determine whether Brown, who had a public defender, could afford his own lawyer. But the plaintiffs say Brown was never charged with withholding funds from his public defender, that the purpose of the fundraiser was to hire private counsel, and that the amount raised was available on a public web page.

“This defeats defendants’ arguments that the [first amended complaint] did not plausibly allege a retaliatory motive and that the government’s legitimate purpose in issuing the subpoena outweighs potential First Amendment concerns,” James ruled.

James refused to dismiss a claim that the federal government violated the Stored Communications Act by demanding WePay turn over records identifying anonymous donors.

However, she dismissed claims for injunctive relief against Smith and Heath, finding the donors failed to show there was a threat of immediate future harm or repeated violations.

“The [first amended complaint] does not set forth the basis for Donor Number 1’s belief that defendants continue to maintain and use the information more than four years after obtaining it from WePay, rendering this allegation conclusory,” James wrote.

She also dismissed without leave to amend a claim alleging violations of the California Constitution, finding the court lacks jurisdiction over that claim.

She dismissed with leave to amend all claims against Smith and Heath in their individual capacities, finding the court lacks personal jurisdiction over the Texas-based defendants.

First Amendment claims against Heath and Smith in their official capacities were dismissed with leave to amend.

The plaintiffs have until Oct. 24 to file an amended complaint.

Neither side responded to emailed requests for comment Thursday afternoon.

Gallagher and Donor No. 1 are represented by Charles Donovan with Sheppard Mullin Richter & Hampton in San Francisco.

Brown was released to a halfway house in November 2016 and re-arrested in April one day before he was to be interviewed for a PBS documentary, according to an April article by Alex Emmons in The Intercept.

Before his arrest, Brown published articles in The Guardian about hacked emails showing intelligence contractors conspired with corporations to hack and discredit activists and key defenders of Wikileaks, including Glen Greenwald.