Back-to-work legislation for Ontario secondary school teachers has passed into law, making sure teachers in three school boards won't get a chance to strike again this school year.

Both the governing Liberals and Progressive Conservatives supported the legislation, while the NDP opposed it. The bill passed 64 to 18.

Peel, Durham and Rainbow school districts had been on strike, the longest of which was six weeks, when the strikes were deem unlawful by the Ontario Labour Relations Board. That ruling, however, would only hold for two weeks.

Teachers were planning to go back on strike on June 10, when that two-week window expired.

But now that back-to-work legislation has been passed, those teachers will not be able to strike for the rest of the school year.

In a statement, the Ontario Secondary School Teachers' Federation (OSSTF/FEESO) condemned the imposition of back-to-work legislation.

"The legislation that was passed today accomplishes nothing more than to inflame a situation that's already rife with animosity and distrust," OSSTF/FEESO President Paul Elliott said. "For months our members have endured indifference and disrespect from their employers at the local bargaining table, and now the Premier and the Education Minister have added further insult by removing their right to withdraw their services."

Elliott said teachers will return to their classrooms "knowing that Premier Wynne and Minister Sandals have robbed them of a fundamental right."