TORONTO -- Unions representing public school teachers in Ontario have launched a court challenge of the Liberal government's legislation that imposes a contract and takes away their right to strike for two years.

The unions representing elementary and high school teachers and support staff say the legislation strips them of the right to bargain collectively, which they say is a violation of the Charter of rights.

Smokey Thomas of the Ontario Public Service Employees Union says they will do whatever it takes to make sure the legislation is repealed.

NDP Leader Andrea Horwath says she warned the government the legislation was unconstitutional, and says taxpayers will be hit with a big bill when it is struck down by the courts.

But Education Minister Laurel Broten says the government is confident the legislation will stand up to a constitutional challenge because unions were allowed to negotiate deals before it passed the bill.

Unions representing teachers at Catholic and Francophone schools in Ontario did accept the government's original offer, which still allows younger teachers to move up the salary grid but freeze salaries for the majority.

The Progressive Conservatives supported the minority Liberal government's bill to impose a contract on teachers last month, but complained it didn't go far enough.

The Liberals recently unveiled proposed legislation to freeze the wages of 481,000 workers at hospitals, colleges, provincial agencies and the civil service.

The Tories said they can't vote for the bill because it exempts too many workers such as police and firefighters who are employed by municipalities, while the NDP say it is unconstitutional and will not survive a court challenge.

The government says it needs a two-year wage freeze from more than 1.2 million public sector workers so it can trim a $14.8-billion deficit without laying off staff or cutting services.