A U.S. District Court judge in Wisconsin ordered the closure of a secret investigation of fundraising by Republican Gov. Scott Walker's campaign and conservative groups.

In a sweeping ruling Tuesday, the judge said the probe was trampling the defendants' constitutional free speech rights and ordered its immediate closure.

The long-running "John Doe" probe looked into possible illegal coordination between Walker's campaign and the Wisconsin Club for Growth, among other nonprofit groups, in 2011-12. The probes are so named because they require defendant to produce documents but forbid them from talking publicly about them.

The ruling was a surprising twist in a long-running drama that had dogged Walker in one form or another since he became governor. Democratic opponents have often pointed to it as proof that has had serious ethical and legal problems.

But Judge Rudolph Randa said the prosecutors had failed to show that the alleged coordination involved any "quid pro quo" between Walker and the groups — the only standard that would have justified the investigation.

"[The prosecutors'] legal theory cannot pass constitutional muster. The plaintiffs have been shut out of the political process merely by association with conservative politicians. This cannot square with the First Amendment and what it was meant to protect," the judge said.

He ordered the investigation be immediately shut down, the return of all property seized in the probe and the permanent destruction of all other materials obtained through the investigation. For good measure, he said any effort by the prosecutors to continue the probe was grounds for a contempt citation.

Special Prosecutor Francis Schmitz, who was leading the probe, told the Milwaukee Journal Sentinel he would most likely appeal.

The initial probe was launched in May 2010 by the office of Milwaukee District Attorney John Chisholm, a Democrat. Ironically, it was based on information turned over by Walker's office — he was then Milwaukee County executive — after irregularities were discovered in a fund for veterans. Three Walker staffers were eventually convicted but despite much hype, the probe never found any evidence linking him to the activities.

Despite this, prosecutors kept the probe open through the 2012, when Walker had to face a recall election effort. It was finally shut down in March 2013. But prosecutors then launched the second probe, which involved the recall.

In the ruling, the judge emphasized that the alleged coordination amounted to little more than claiming that groups that favored Walker's policies should not be able speak in favor of them, i.e., run political ads.

The ads cited by prosecutors "carry no risk of corruption because the Club‘s interests are already aligned with Walker and other conservative politicians. Such ads are meant to educate the electorate, not curry favor with corruptible candidates," the judge said.

For more on the John Doe probes, see Phil Klein's "Liberals have bubkes on Scott Walker" and my own "The journos and the Scott Walker indictment that wasn't."

Click here for recent Washington Examiner interviews with Scott Walker.