SACRAMENTO — Turning to technology to deter thieves, California became the first state in the country on Monday to require “kill switches” on new smartphones.

Gov. Jerry Brown signed the legislation, capping a long, contentious struggle in which California lawmakers and police went toe-to-toe with the smartphone industry over how best to curb an epidemic of thefts plaguing the Golden State.

The action came as Sacramento shifted into legislative overdrive Monday, with lawmakers starting to vote on hundreds of bills in the final week of their session. Among the highlights: A controversial ban on plastic grocery bags failed in an Assembly vote but is expected to get one more chance later this week. The Assembly did approve “Audrie’s Law,” a South Bay senator’s bid to tighten juvenile sexual assault laws.

The new phone law requires that all those manufactured after July 1, 2015, and sold in California have anti-theft security features that would render stolen devices inoperable — a “kill switch” for remote deactivation. Such technology exists, but phone owners must choose it; the new law requires it to be standard on all phones, and owners can opt out if they wish.

“California has just put smartphone thieves on notice,” state Sen. Mark Leno, the bill’s co-author, said Monday. “Our efforts will effectively wipe out the incentive to steal smartphones and curb this crime of convenience, which is fueling street crime and violence within our communities.”

Brown’s signature was “a victory for consumer safety,” said Assemblywoman Nancy Skinner, D-Berkeley, who co-authored the bill. She and Leno, D-San Francisco, had carried the bill with sponsorship by San Francisco District Attorney George Gascon, who predicted “soon, stealing a smartphone won’t be worth the trouble, and these violent street crimes will be a thing of the past.”

The number of U.S. smartphone-theft victims nearly doubled from 1.6 million to 3.1 million between 2012 and 2013, according to Consumer Reports. And the Bay Area has been a hot spot: Oakland Mayor Jean Quan said up to 75 percent of her city’s robberies and burglaries involve phones.

All of the major cellphone companies followed Apple’s lead and removed their opposition to the bill.

But the California Chamber of Commerce opposed the mandate, saying it “stifles innovation of new technologies” by not allowing consumers to select from a variety of anti-theft alternatives on the market.

The CTIA, a wireless telecommunications trade group, said the industry already has rolled out stolen-phone databases, consumer education campaigns, anti-theft apps and a plan for a national technology solution to the problem.

“Today’s action was unnecessary,” said Jamie Hastings, a CTIA spokesman.

Even the Electronic Frontier Foundation, a San Francisco-based civil liberties group, urged the bill’s defeat because it “is not explicit about who can activate such a switch,” leaving Californians’ rights vulnerable to abuse either by hackers or by law enforcement. But the bill’s supporters said abuse is unlikely, and the mandate could save lives. New York Attorney General Eric Schneiderman said Monday he would “urge states nationwide to follow California’s lead.”

Meanwhile, the bill to make California the first state to ban single-use plastic grocery bags appeared to be foundering after a late push by industry lobbyists to kill the proposal. After a lengthy debate, the bill, SB 270, failed in the Assembly, falling three votes short of the 41 required to pass. Assembly Republicans were expected to vote against the bill, but opposition from Assembly Democrats has stalled the legislation; 10 voted against the bill and nine abstained.

Some lawmakers derided the measure’s requirement that stores charge a 10-cent fee for reusable bags. Others said they need grocery bags around the house to dispose of their pets’ waste.

Although the failed vote is a setback for Sen. Alex Padilla, D-Pacoima, the bill’s sponsor, it’s not the end of the line. He’ll get one more chance later this week to get the bill through the Assembly. If he’s successful, the bill would also need approval from the state Senate before Sunday’s deadline.

Environmental advocacy groups say the legislation is needed to reduce a nasty form of litter that easily blows away from landfills and pollutes the Pacific Ocean.

There was no opposition Monday when the Assembly voted 72-0 to pass Sen. Jim Beall’s SB 838, named for 15-year-old Audrie Pott, a Saratoga High School student who killed herself in 2012 after photos of her sexual assault by classmates were shared with other students.

The bill would require juvenile sex offenders to undergo mandatory rehabilitation and counseling. It would also prevent juveniles from getting rape, sodomy or oral copulation convictions dismissed by paying a fine, doing community service or attending a treatment program.

The bill now returns to the Senate for a concurrence vote on some Assembly amendments.

Follow Josh Richman at Twitter.com/josh_richman and Jessica Calefati at Twitter.com/Calefati. Read the Political Blotter at IBAbuzz.com/politics.