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.

At Fanshawe College, officials say classes for all students will resume on Tuesday.

The college will extend the fall semester until January 16. Classes will run until Friday, December 22 and restart on Wednesday, January 3.

There will be no classes or exams held between Saturday, December 23, 2017 and Tuesday, January 2, 2018, the college says.

"In the coming days we will provide details about how students will complete their semester as well as information about the student support fund as announced by the Ontario government," a statement from the college states.

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