Image caption Tens of thousands of demonstrators rallied at the state capitol to protest against the new law

A US judge in Wisconsin has issued a temporary restraining order blocking the state's new collective bargaining law from taking effect.

Public-sector unions' bargaining rights would be affected by the law, if it is published later this month.

Judge Maryann Sumi issued the order, which is being seen as a setback to Republican Governor Scott Walker.

Tens of thousands of people rallied at the state capitol in recent weeks in protest against the anti-union measure.

Dane County District Attorney Ismael Ozanne filed a lawsuit contending that a legislative committee which broke a stalemate that had kept the bill in limbo for weeks met without the 24-hour notice required by Wisconsin's open meetings law.

Last month, US state's 14 Democratic senators had sought to prevent the bill moving forward by fleeing the state, leaving the chamber short of the number needed for a vote.

But Republicans used a procedural move last week to allow them to pass the measure in committee instead. Mr Walker signed it into law shortly afterwards.

The state's justice department argued that it had given enough notice of the committee meeting when it posted a memo on a bulletin board two hours beforehand.

The law was to be published on 25 March, but the new restraining order will now prevent that from happening.

Remaining 'confident'

Cullen Werwie, a spokesman for Mr Walker, said he was confident the law would still be published in the near future.

"This legislation is still working through the legal process," Mr Werwie said.

But Democrats were hopeful Republicans in the state would come back to the negotiating table.

"I would hope the Republicans would take this as an opportunity to sit down with Democrats and negotiate a proposal we could all get behind," said Democratic Senator Jon Erpenbach.

The state faces a $3.6bn (£2.23bn) budget deficit in the coming two-year period. Mr Walker and Republicans say the law on labour unions is needed to help the state balance that deficit.

If implemented, the legislation would affect rubbish collectors, teachers, nurses, prison guards and other public workers.