In a sharply-worded ruling Tuesday that raised the specters of the guillotine and the gulag, a federal judge in Wisconsin handed a big win to Gov. Scott Walker (R), by ordering state prosecutors to halt to the secret “John Doe” probe investigating Walker’s 2012 recall election.

“The Defendants must cease all activities related to the investigation, return all property seized in the investigation from any individual or organization, and permanently destroy all copies of information and other materials obtained through the investigation,” U.S. District Judge Rudolph Randa wrote at the end of his 26-page decision. “Plaintiffs and others are hereby relieved of any and every duty under Wisconsin law to cooperate further with Defendants‘ investigation.”

The case was brought by Wisconsin Club for Growth, one of the conservative groups targeted by the investigation, against the several prosecutors and the state judge involved in the “John Doe” probe, a type of proceeding prosecutors in Wisconsin use to determine whether or not to charge a criminal offense.

“John Doe” probes operate in secret, and while reports of the probe’s activities had been coming out for months, Randa’s ruling shed light onto what exactly the prosecutors were looking at. According to Randa, who was appointed to the bench in 1992 by President George H.W. Bush, the investigation was targeting allegedly illegal campaign coordination between Walker’s campaign and outside conservative groups. Ultimately, Randa wrote, “all or nearly all right-of-center groups and individuals in Wisconsin who engaged in issue advocacy from 2010 to the present [became] targets of the investigation.” (Issue advocacy, broadly, is a kind of political speech that doesn’t expressly call for the election or defeat of a particular candidate.)

In particular, prosecutors were focused on the activities of a man named Richard “R.J.” Johnson, who they said controlled Wisconsin Club for Growth and used it as “hub” to coordinate fundraising and “issue advocacy” involving Walker’s campaign and numerous other outside spending groups, including Citizens for a Strong America, Wisconsin Right to Life, and United Sportsmen of Wisconsin. Johnson also allegedly worked a “representative and agent” of the Walker campaign.

In his ruling, Randa sided with Wisconsin Club for Growth and its director, Eric O’Keefe, who argued that the “John Doe” investigation had “devastated” the group’s ability to fundraise and engage in issue advocacy, and had limited it and other conservative group’s participation in the 2014 election cycle. In his ruling for the conservative group, Randa cited several Supreme Court cases, including the recent McCutcheon v. Federal Election Commission, to say that issue advocacy speech can only be viewed one way — as “protected First Amendment speech” — and to cast doubts on the government’s right to regulate it.

“This is not a recognition that quid pro quo corruption is the only source of corruption in our political system or that issue advocacy money could not be used for some corrupting purpose,” Randa wrote. “Rather, the larger danger is giving government an expanded role in uprooting all forms of perceived corruption which may result in corruption of the First Amendment itself. … As other histories tell us, attempts to purify the public square lead to places like the Guillotine and the Gulag.”

Recent Supreme Court cases, including the 2010 Citizens United v. Federal Election Commission, have removed various limits on political donations, and have lead to a surge in outside political spending in recent election cycles. One limit that has remained has been the ban on campaigns coordinating with outside spending groups. But Randa wrote that when it comes to issue advocacy, “[c]oordination does not add the threat of quid pro quo corruption that accompanies express advocacy speech.”

“O‘Keefe and the Club obviously agree with Governor Walker‘s policies, but coordinated ads in favor of those policies carry no risk of corruption because the Club‘s interests are already aligned with Walker and other conservative politicians,” Randa wrote. “Such ads are meant to educate the electorate, not curry favor with corruptible candidates.”

Randa wrote that “[m]aximizing the capability” of 501(c)4 organizations — non-profits sometimes called “dark money” organizations — maximizes First Amendment political freedoms and “may be the best way, as it has been in the past, to address problems of political corruption.”

“The plaintiffs have found a way to circumvent campaign finance laws, and that circumvention should not and cannot be condemned or restricted,” Randa wrote. “Instead, it should be recognized as promoting political speech, an activity that is ‘ingrained in our culture.'”

Despite Randa’s ruling, the fight over the investigation may not be over. On Wednesday, the state prosecutors, led by Francis Schmitz, a former federal prosecutor who has been leading the “John Doe” probe as a special prosecutor, appealed the decision to the U.S. Court of Appeals for the Seventh Circuit.

Read Randa’s ruling:

John Doe Randa Ruling