Ontario has passed back-to-work legislation, ending a five-week college strike and paving the way for students to return to class.

The Liberal government first attempted to introduce the bill Thursday evening, after restarted talks between the colleges and the faculty's union reached an impasse.

But unanimous consent of all parties was needed, and the NDP refused, leading the government to introduce the legislation Friday.

It was debated through special weekend sittings in which the NDP argued it takes away workers' rights and only comes after the Liberals failed to bring the two sides together for five weeks.

The colleges have said they would need two days to restart classes, meaning students could be back on Tuesday.

Around 500,000 students have been out of class since the strike by 12,000 professors, instructors, counsellors, and librarians began Oct. 15.