SACRAMENTO (CBS / AP) — A bill that would require law enforcement agencies in California to obtain search warrants before they could access private emails, text messages and other electronic communications narrowly won bipartisan approval from the state Assembly on Tuesday.

Lawmakers who were supporters of the bill, SB178, argued Tuesday that the legislation was a long-overdue effort to protect citizens from unreasonable government intrusion in the age of the Internet, smartphones and tablets.

READ MORE: UPDATE: Marin Water Board Lifts Some Water Restrictions, Penalties Following Early Season Storms

“It makes no sense that the email in your inbox should enjoy different protections than the mail in your mailbox,” Assemblyman Jay Obernolte, R-Big Bear Lake, urging colleagues to vote for the so-called California Electronic Communications Privacy Act.

Opponents, however, said the bill would hamper the ability of law enforcement to investigate child pornographers and others who commit crimes online.

Assemblyman Jim Cooper, D-Elk Grove, who previously oversaw a high-tech crimes unit as a Sacramento County sheriff’s captain, made an impassioned speech against the bill. He said it “places impractical and unrealistic restrictions when it comes to conducting an investigation of these networks,” and it could cause even investigators who obtained search warrants to end up having their evidence suppressed in court.

“Let’s put kids rights first, not Internet privacy,” he said.

READ MORE: San Jose Police Investigate Officer-Involved Shooting With Carjacking Suspect

Assembly Minority Leader Kristin Olsen, R-Riverbank, said she was satisfied lawmakers had adequately addressed concerns expressed by police and prosecutors.

“I’m the mother of three kids. I’ve worked with abused children over a number of years,” Olsen said. “I spoke with law enforcement to make sure nothing in this bill would prevent us from going after people who commit crimes of child pornography with the same vigilance they do today. This bill simply says no one should be able to search our phones without a search warrant.”

When it was first brought to a vote, the measure fell 11 votes shy of the 54 votes needed for passage. It was tabled for a few hours and then resurrected as its sponsor, San Francisco Democratic Sen. Mark Leno, roamed the Assembly floor and anxiously watched the vote count as the tally inched up and down.

The bill eventually passed on a 55-11 vote.

It now goes back to the Senate for a final vote.

MORE NEWS: San Mateo Police Investigate Shooting in Hillsdale Mall Parking Lot

© Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.