TORONTO -- Premier Kathleen Wynne distanced herself Thursday from legislation brought in by her predecessor to impose contracts on teachers -- a move a judge has ruled violated their constitutional collective bargaining rights.

Ontario Superior Court Judge Thomas Lederer ruled Wednesday that the government "substantially interfered with meaningful collective bargaining" in passing the 2012 legislation.

"The process engaged in was fundamentally flawed," he wrote.

"It could not, by its design, provide meaningful collective bargaining. Ontario, on its own, devised a process. It set the parameters which would allow it to meet fiscal restraints it determined and then set a program which limited the ability of the others parties to take part in a meaningful way."

Known as Bill 115, it imposed contracts on teachers that froze some of their wages and limited their ability to strike, so five unions took the government to court. The judge sided with them, but left the question of a remedy up to the government and unions to decide.

Wynne said the government is reviewing the decision, but noted that she has taken issue with the legislation in the past.

"I can't give you chapter and verse on exactly the implications, but I can tell you that that legislation was very problematic," she said Thursday.

"When I ran in the leadership (race) starting in 2012, I was clear that we needed to move away from the rancour that had been created because of that legislation."

But that was after the legislation had passed, and as a member of cabinet at the time in Dalton McGuinty's government, Wynne helped pass the bill and even spoke in favour of it during debate. However, she suggested at the time, in the legislature on Aug. 30, 2012, that there was some dissent about it within the party.

"Only someone who does not appreciate the importance of honest, heartfelt discussion would criticize a team that allows that debate, then comes to a conclusion and stands together and takes a stand," she said in response to Opposition criticism.

The education minister at the time was Laurel Broten, who is no longer a member of the Ontario government, but current Education Minister Liz Sandals also distanced herself Thursday. She and Wynne are doing things differently, she said.

"We actually believe in collective bargaining, both the premier and I having had a background of being trustees, understand that while bargaining may be difficult...we both believe very sincerely that it's important to reach bargained agreements," Sandals said.

The legislation came at a time when the government was constraining spending, implementing a public sector wage freeze. The judge called it telling that even though all sectors were experiencing the same fiscal concerns at that time, Ontario allowed for free negotiations in other sectors.

Smokey Thomas, the president of the Ontario Public Service Employees Union, said the decision confirms that the Liberal government trampled workers' charter rights "in its fanatical pursuit of reduced wages and working conditions."

NDP Leader Andrea Horwath said the Liberals brought in the legislation despite warnings from various sides that it was unconstitutional.

Progressive Conservative Leader Patrick Brown said the minister's office clearly didn't do proper research when the contracts were imposed.