A bi-partisan bill being discussed by lawmakers in California could keep police agencies and other government entities from using drones to conduct warrantless surveillance across the state.

The bill, AB 1327, would require law enforcement, fire departments and investigative agencies to get a judge’s permission before putting an unmanned aerial vehicle, or drone, into California airspace to collect intelligence. It passed the State Assembly on Wednesday by a 59-5 vote.

Assemblymember Jeff Gorell (R-Camarillo) — a co-author of the bill and a former United States Navy intelligence officer — is hoping to get the act approved by the State Senate and signed into law by Governor Jerry Brown, a Democrat. The Senate received a copy after Wednesday’s vote.

Thousands of drones are expected to be dominating American airspace by the end of the decade, though few measures to restrict their use have fully materialized as of yet. The state of Virginia agreed last year to put a 24-month moratorium on UAV use there, but similar legislation has been few and far between elsewhere. Should this effort succeed, then Californians — around 38 million of them — would be largely spared from being spied on by surveillance drones.

“People are flying model aircraft all the time – not for surveillance but just for a hobby – and that’s not restricted by FAA,” Gorell told KNX 1070, a local news radio station, earlier this week. “So there’s absolutely a requirement for legislatures to look at this.”

"We also have to recognize there are going to have to be some parameters in place around how we use unmanned aerial vehicles," he added to the Los Angeles Times. "We want Californians to feel confident that this legislative body is protecting their right to privacy."

Gorell, who represents a suburb north of LA, is worried that lightweight drones outfitted with high-definition cameras will be abused by law enforcement agencies and deployed to do surveillance over huge swaths of space.

"The drones can loiter for long periods of time with stealth-like capacity over homes or businesses or public areas," he told the Times. Indeed, some drones already in operation are capable of collecting personalized data on subjects from as far away as 60,000 feet off the ground, and just this week a North Dakota farmer was sentenced to three years in prison in a case where a drone directly led to his arrest.

Should Gorell’s bill get to Gov. Brown’s desk and be signed into law, a judge would need to sign an order authorizing drones to collect information from the air.

“Drones are going to be extremely important for hot pursuit, which is allowed in this bill, for search and rescue and, when you get a warrant, for continuous surveillance” of a location, said Assemblyman Bill Quirk (D-Hayward), a co-author of the bill.

The measure would not outright ban those surveillance missions, but add a layer of oversight to ensure law enforcement agencies don’t deploy drones without judicial approval. In cases of emergency, however — such as hostage situations, dangerous pursuits and massive fires — Gorell’s bill would still let certain agencies send drones into the sky when other options would prove ineffective. Another provision, though, lets police do drone searches over illegal marijuana farms without requiring a warrant.

“The right answer is to embrace this technology because it is the future,” bill co-author Assemblyman Jeff Gorell (R-Camarillo) added during this week’s hearing.

If approved, the bill would also officially ban any and all weaponized drones in California.