Pro-union protesters have vacated the Wisconsin capitol on the 17th day of round-the-clock demonstrations after a judge ordered the building closed at night.

Dane County Circuit Judge John Albert issued a verbal order Thursday night that about 100 protesters who had been camped out in the capitol building in Madison for more than two weeks should be removed as soon as authorities believed they could do so with minimum risk of injury to protesters and police.

It was a dramatic development in the battle between the state's Republican governor and public sector unions whose collective bargaining power he wants to cripple.  

Protesters left the building peacefully about two hours after the judge's ruling came down. Even though the judge ruled the state had unconstitutionally restricted access to the building, he said the protesters had to leave.  

The protesters are opposed to a bill pushed by Gov. Scott Walker that would strip most public employees of most of their collective bargaining rights.

As protesters were being urged to leave by police and a lawyer who represents unions, the governor threatened to issue thousands of layoff notices if Democratic state senators failed to return for a vote on a measure to slash collective bargaining rights for most state workers.

Democrats want to escape vote

Fourteen Democratic senators have fled to neighbouring Illinois to avoid having to vote on the measure, which had been passed earlier by the state assembly. 

Walker said he hoped to work out a deal with the absent Democrats. But in an interview, he said he wouldn't budge on the key issue of eliminating public sector collective bargaining rights or anything else he believes would save the state money.

"I can't take any of that off the table," he said. "We cannot tear apart this budget. We cannot put this burden on local governments. But if there are other ways they are willing to work with us to find a pathway back, I think that's what people want."

In the meantime, Walker's Republican colleagues in the state senate have been busy raising their own pressure on the absent Democratic senators. Republican senators on Thursday authorized police to round up the AWOL lawmakers. 

Senate Democrats said they couldn't be arrested because they hadn't done anything illegal. "There are so many police supporting us, they might have a hard time finding one to bring us back," said Sen. Chris Larson.

Closely watched battle

Walker's attack on union rights has galvanized the union movement in Wisconsin and led to a round-the-clock sit-in at the capitol since mid-February.

Protesters say Walker's real agenda is ideological — union busting — and not deficit cutting. They say they've offered concessions on pay and note that Walker is lowering taxes.

The battle in Madison is being closely watched far beyond Wisconsin's borders, as other cash-trapped states — especially those led by right-of-centre governors —  look for ways to limit the pay and power of public sector unions.

Neither side appears at this point to be willing to back down.

With files from the CBC's Paul Hunter and The Associated Press