California lawmakers voted Friday to bar middle and high schools from starting before 8:30 a.m., one of dozens of proposals debated in the Legislature on the final day of its legislative session.

The bill, SB328, narrowly passed in both chambers. The development came as lawmakers scrambled to pass bills ahead of a midnight deadline, addressing topics ranging from internet neutrality and smoking at state beaches.

Lawmakers also announced they were shelving several high profile bills, including one that would have declared gay conversion therapy a fraudulent business practice.

IN-N-OUT BURGER CHAIN RECEIVES INVITATION FROM ALABAMA LAWMAKER AMID CALLS FOR CALIFORNIA BOYCOTT

Nearly 80 percent of California middle and high schools started earlier than 8:30 a.m. in 2012, according to the Centers for Disease Control and Prevention.

If Gov. Jerry Brown signs SB328, schools will have about three years to comply. It would not apply to rural schools or to extra periods offered before the start of a school day. It would not mandate changes to school day lengths.

Supporters point to science that shows later start times make kids healthier by letting them get more sleep and help them graduate.

"This is the single most cost-effective thing we can do to improve high school graduation rates," Assemblyman Jay Obernolte, R-Hesperia, said.

CALIFORNIA BULLET TRAIN PROJECT ON TRACK TO BLOW THROUGH BILLIONS OF MORE DOLLARS

Opponents say local school boards, not the state, should determine start times.

"When it comes to education, the farther away the decisions are made from the classroom, the worse those decisions are," Assemblyman Jose Medina, D-Riverside, said.

Also on Friday, Assemblyman Evan Low announced he was ending his effort this year to pass a bill declaring gay conversion therapy a fraudulent practice.

The Campbell Democrat said he authored the bill because conversion therapy has been proven ineffective and harmful. His measure would have banned selling or advertising sexual orientation change therapy.

But Low said he needs more time as he tries to craft a national model that could be copied in other states.

The bill had passed both the Senate and Assembly and was awaiting a final Assembly vote to send it to Brown.

Low said he has had productive conversations with opponents, some of whom say lawmakers shouldn't limit therapy choices and others fighting the proposal on religious grounds at emotion-charged legislative hearings.