John Bacon

USA TODAY

Wisconsin's controversial 2011 law that severely limited collective bargaining for public workers, sparked massive protests and drove the failed effort to recall Republican Gov. Scott Walker was upheld Thursday by the state's highest court.

The Wisconsin Supreme Court closed the book on the last of the major legal disputes over Act 10, ending a three-year legal struggle with its 5-2 decision.

The decision could energize the political career of Walker, who seeks re-election this year and has not ruled out a 2016 run for president.

"Act 10 has saved Wisconsin taxpayers more than $3 billion," Walker said. "Today's ruling is a victory for those hardworking taxpayers."

The ruling came in a lawsuit filed by unions representing Milwaukee public workers and teachers in Madison. Walker was forced to stand for recall in 2012, a move largely propelled by unions and their outrage over Act 10. Walker held on, becoming the first governor in U.S. history to defeat a recall.

The Madison teachers union issued a statement calling the ruling "not only disappointing but morally bankrupt." The union referenced the harsh dissent, written by Justice Ann Walsh Bradley, that said the ruling "simply did not address the issues presented to the court ... but 'reframes,' 'dodges' and twisted the issues to enable their own desired outcome."

The law has weathered a storm of legal challenges on several fronts. The state Supreme Court took the case after a Dane County judge ruled in September 2012 that major portions of the law were unconstitutional.

Walker has been a lightning rod for controversy beyond the union struggle. In documents unsealed last month, prosecutors claimed he was at the center of a plan to illegally coordinate fundraising with an array of outside conservative groups to help him and several Republican senators survive a 2012 recall election.

In the documents, prosecutors from five Wisconsin counties allege an effort by Walker and top aides to circumvent state law and raise money and plan spending by a dozen outside groups during the election. No charges have been filed against Walker or any of his staffers.

The allegations were made by the county prosecutors as part of their long-running probe into the political activities of Walker's campaign and outside groups during the recall election. The Wisconsin Club for Growth sued in federal court to stop the investigation, arguing that it violates its free speech rights. A federal judge agreed and twice ordered a stop to the investigation.

A federal appeals court is reviewing the decision. It unsealed the documents containing the prosecutors' claims.

Walker and his aides have downplayed the significance of the prosecutors' allegations and noted that a state judge turned down prosecutors' efforts to obtain subpoenas in the criminal probe.

"The judiciary at both the state and federal made it clear they felt there wasn't a case here," Walker said last month.

Contributing: Fredreka Schouten and Aamer Madhani