After hours of debate, members of the Alberta legislature passed human rights legislation allowing parents to pull their children out of classes dealing with sex, religion or sexual orientation.

Bill 44 was adopted at about 1:30 a.m. MT Tuesday.

Prior to its adoption, members of the legislature heard objections from teachers, school boards and human rights groups.

The groups in opposition said the issue should be addressed as part of the Schools Act instead of as a human right.

They also claim the law is too vague, which could create problems for teachers who are trying to do their job.

With the legislation in place, school boards are now required to notify parents in writing any time the controversial topics will be "explicitly" covered in class.

"We want to nail down exactly what's required for notification -- when it's required, exactly on what topics it's required, how often, and we'll be seeking our own legal advice ... on that," Alberta School Boards Association president Heather Welwood said Monday.

Frank Bruseker, president of the Alberta Teachers' Association, said the legislation makes it difficult for teachers.

"We'll need to review curricula right across all subjects and all grades to see where there might be a minefield, if you will, that a teacher might step in and suddenly find themselves in deep trouble."

Critics have suggested the parental provision was added to Bill 44 to appease far-right Conservatives displeased with the bill also enshrining gay rights under the Human Rights Act.

On Monday, a group of gay and lesbian protesters rallied against the bill outside the legislature.

Meanwhile, students have been debating Bill 44 online.

"This bill will hinder our learning about diversified groups in our country; thus, attempting to restrict the adults of tomorrow by cutting us off from the issues of today," Grade 10 student Katherine Creelman wrote in a letter posted to a Facebook page called "Students against Bill 44."

That group had nearly 2,000 members on Monday while the group "Students for Bill 44" had about 30 members.

With files from The Canadian Press