Wisconsin Gov. Scott Walker addresses a joint session of the Legislature in the Assembly chambers at the state Capitol, Tuesday, Jan. 15, 2013, in Madison, Wis. AP Photo/Andy Manis

SCOTT BAUER and TODD RICHMOND, Associated Press

MADISON, Wis. (AP) — A federal appeals court on Friday upheld Wisconsin Gov. Scott Walker's contentious law stripping most public workers of nearly all of their collective bargaining rights, a victory for Republicans and a decision that runs contrary to one issued last year in state court.

The 7th Circuit Court of Appeals in Chicago found the law is constitutional and its ban on the automatic deduction of union dues is acceptable. In September, a state circuit court judge said the law was unconstitutional as it applied to school and local government workers.

Republican supporters of the law, including Walker, praised the federal court decision and said it should lead to an end to other pending litigation.

"While there are no guarantees, it is my hope that this decision will pave the way for resolving any remaining challenges in a manner that supports the legislative decisions made by our elected officials," Republican Attorney General J.B. Van Hollen said in a statement.

Walker and Republican Senate Majority Leader Scott Fitzgerald, who fought for passage of the bill even as all 14 Wisconsin Democrats fled to Illinois to hold up a Senate vote, called the ruling a victory for Wisconsin taxpayers.

Police drag a protester away from the vestibule in front of the Wisconsin state assembly chamber in the Capitol on March 10, 2011 in Madison, Wis. The protesters were blocking the entrances to the chamber hoping to prevent the Assembly from meeting. Scott Olson/Getty Images

"As we've said all along, Act 10 is constitutional," Walker said in a statement, referring to the official name of the law.

Seven public unions, including the state's largest teachers' union and the largest statewide public sector union, challenged the law's constitutionality in 2011. U.S. District Judge William Conley in March overturned a part of the law requiring unions to hold elections each year for members to decide whether the unions should continue to exist. The judge also said the law illegally halted the automatic withdrawal of union dues.

The appeals court reversed that ruling and declared the law in its entirety constitutional.

Van Hollen, who handled the appeal on behalf of the state, said the ruling confirms "what I have stated from the beginning. (The law) is constitutional."

The union attorney who argued the case, Leon Dayan, did not immediately return a message seeking comment.

Democratic Assembly Leader Peter Barca said the court upheld the law on "narrow legal grounds."

"The court did acknowledge that Act 10 appears to be an act of favoritism for 'friends' and punishing enemies," Barca said. "... Given the recent focus on bipartisanship, now would be a good opportunity to move away from positions the court acknowledges are likely favoritism and punishment."

The decision drew praise from the Wisconsin state director of Americans for Prosperity, the conservative advocacy group that led the successful push for right to work legislation in Michigan last month.

The law has been an "unmitigated success for Wisconsin," AFP state director Luke Hilgemann said.

Demonstrators protest in the capitol rotunda after they were given a deadline by the police to leave the building on Feb. 27, 2011 in Madison, Wis. Scott Olson/Getty Images

"While Washington is arguing about how much to raise the debt ceiling, Wisconsin is showing the rest of the nation what responsible budgeting looks like," Hilgemann said.

In a separate case, a Dane County circuit judge in September ruled that the law violated constitutional rights of free speech, free association and equal representation. That ruling blocked the law from being applied to school and local government workers, but it remains in effect for state workers and employees of the University of Wisconsin System.

That case was brought by Madison Teachers Inc. and Public Employees Local 61. The state has appealed.

A second federal lawsuit, brought by a Madison chapter of the AFL-CIO and a Dane County chapter of AFSCME, alleged that the law violated their constitutional rights to freely assemble, free speech and equal protection.

That case is pending.

In November, a law enforcement union filed a lawsuit in Dane County Circuit Court challenged the law as a violation of constitutional rights of free speech, association and equal protection. That lawsuit challenged the law as it pertains to law enforcement officers who had been represented for collective bargaining purposes by the Wisconsin Law Enforcement Association.

A status conference on that case is set for Tuesday.