A bill requiring that all smartphones sold in California contain a “kill-switch” that allows users to disable them if stolen was approved by the California Assembly on Thursday morning.

The bill had previously been approved by the state’s senate although it will have to return for a vote on amendments made by the assembly. If those are approved, it will pass into law once signed by Governor Jerry Brown.

The California bill mandates that all smartphones contain software that will allow the user to remotely wipe the phone of personal data and lock it so it cannot be used unless an unlocking code is entered. The software will need to be resistant to attempts to replace the phone’s operating system, be enabled by default but with the possibility of being disabled by consumers, and be on all phones manufactured after July 1, 2015, and sold in the state.

One of the amendments made to the bill in the assembly allows for phones that were introduced prior to 2015 “that cannot reasonably be reengineered” to continue to be sold past July 1, 2015.

Proponents of the bill say that it will reduce smartphone theft because thieves are much less likely to steal phones if the handsets quickly become unusable.

“We are on the verge of implementing regulations that will have tremendous benefits to public safety,” said San Francisco District Attorney George Gascon, who has been one of the leading forces behind the bill. “We are on the eve of securing wireless consumers everywhere from the violent threat of theft.”

The California bill would be the second state law in the country mandating a kill switch. The first was passed in Minnesota in May. There are also two bills in the U.S. Congress that are similarly seeking a mandated kill switch.

The wireless industry had initially objected to the law saying it would make smartphones more vulnerable to hackers, but earlier this year reversed its stance and began supporting the kill switch.

To date, only Apple has implemented a kill switch in its phones but Google and Microsoft have both committed to adding one to upcoming updates to their respective smartphone operating systems.