(CNN) -

Wisconsin's top court Tuesday reinstated a contentious law that curbs the collective bargaining rights of most state employees.

The state's Supreme Court, by a 4-3 vote, set aside a ruling by a lower court judge who had placed a permanent injunction against the law. The court ruled the state Legislature did not violate the state's constitution when it passed the legislation.

"The Supreme Court's ruling provides our state the opportunity to move forward together and focus on getting Wisconsin working again," Gov. Scott Walker said in a statement.

The Wisconsin AFL-CIO criticized the ruling.

"The inability of the Wisconsin Supreme Court to separate partisan politics from the well-being of Wisconsinites is the latest indication that citizens do not have a voice in this state," it said in a statement. "And the only way for Wisconsinites to repair that voice is to take back the Senate this summer, stop Walker's unbridled assault on working people and take back the statehouse in 2012."

The law, which sharply curbs the collective bargaining rights of most state employees, sparked an extremely heated, high-stakes political fight. Republicans insist that the measure is necessary to control skyrocketing public employee benefit costs and close a $137 million budget shortfall. Democrats argue that it is little more than an attempt to gut public-sector labor unions, one of their core constituencies.

Under the Wisconsin law, all public workers except police and firefighters would be required to cover more of their retirement plan contributions and health care premiums.

Raises would be tied to the rate of inflation, unless state voters approve an exception. Unions would be required to hold a new certification vote every year and would no longer be allowed to collect dues from workers' paychecks.

The state Supreme Court overturned a ruling by Judge Maryann Sumi, who said GOP legislators failed to provide sufficient public notice before passing the measure this year.

Walker's legislation prompted massive protests inside and outside the state Capitol earlier this year. A group of Democratic lawmakers left the state rather than allow a vote quorum.

Eventually, the law was passed and signed by Walker in March.