SACRAMENTO — California lawmakers Tuesday rejected a bill that would have made it a felony for teachers to date their students.

The legislation was prompted by the high-profile case of a 41-year-old Modesto teacher who left his wife and three children to move in with an 18 year-old student.

The Assembly Committee on Public Safety voted 3-0 against AB 1861. Its two Republican members were absent, and one Democrat abstained from voting.

Assemblywoman Kristin Olsen, R-Modesto, who sponsored the bill, accused committee members of siding with predators.

“The committee today stood up for predators and union bosses instead of students,” Olsen said in a phone interview. “We will continue to work hard to make sure that California passes this bill or something similar.”

Olsen’s bill would have made it a felony for a high school teacher to have a relationship with a student, regardless of the student’s age. It also would have stripped offending teachers of their pensions and retiree health care benefits. In California the age of consent is 18.

The bill was prompted by the relationship of teacher Christopher Hooker and student Jordan Powers. The two appeared on national talk shows this year and maintained they didn’t have a sexual relationship until she turned 18.

Hooker was arrested this month on suspicion of sexually abusing a different student more than a decade ago. A judge entered a not guilty plea on his behalf. He and Powers broke up after the allegation surfaced.

The California Federation of Teachers and American Civil Liberties Union opposed the bill, and several committee members said the bill was an overreaction to an isolated case.

“When there’s an individual case like this that attracts attention, the visceral takes over,” said committee chairman Tom Ammiano, D-San Francisco.

Ammiano called the bill “not fully baked” and suggested it might violate the rights of consenting adults.

Olsen said at least 16 other states have passed similar laws. She said it was not knee-jerk legislation.

Assemblywoman Holly Mitchell, D-Los Angeles, objected to targeting the pensions of a single group of public employees. She said she would be open to a bill that made teacher-student relationships a felony but did not go after retirement benefits.