SACRAMENTO, Calif. (AP) — California Gov. Gavin Newsom vetoed a bill Monday that he said could have brought “a world of unintended consequences” by allowing Los Angeles, Oakland, and San Francisco to set up sites where opioid users could legally inject drugs under supervision.

“The unlimited number of safe injection sites that this bill would authorize — facilities which could exist well into the later part of this decade — could induce a world of unintended consequences,” Newsom said.

While he said they could be helpful, he worried that “if done without a strong plan, they could work against this purpose. … Worsening drug consumption challenges in these areas is not a risk we can take.”

It was one of the most watched and most controversial measures of this legislative session.

Proponents wanted to give people who already would use drugs a place to inject them while trained staff stand by to help if they suffer accidental overdoses.

The proposal came amid a spike in overdose deaths amid a national opioid crisis. But opponents said the move in effect would have condoned the use of dangerous drugs.

“Each year this legislation is delayed, more people die of drug overdoses,” said state Sen. Scott Wiener, a Democrat from San Francisco who authored the California legislation.

Newsom, a Democrat, had previously said he was open to the idea. But his decision comes as he faces increased national scrutiny as he is perceived as a possible presidential contender, though he has frequently denied any interest in running.

He said he has long supported cutting-edge harm reduction strategies, but not without “well-documented, vetted, and thoughtful operational and sustainability plans.”

Newsom ordered his secretary of Health and Human Services to meet with city and county officials to discuss standards and best practices and said he remains open to the concept once they come back to lawmakers with recommendations for how the sites could be run safely.

Wiener called Newsom’s veto “tragic,” and San Francisco Mayor London Breed said the veto by the former mayor of San Francisco is “disappointing.”

“We don’t need additional studies or working groups to determine whether safe consumption sites are effective,” Wiener said. “These sites are a proven strategy to reduce overdose deaths, pressure on emergency rooms, and public drug use while expanding access to drug treatment.”

But Senate GOP Leader Scott Wilk said in a statement at the same time that the bill amounts to “giving people free needles and a safe place to shoot up.”

Wilk and other Senate Republicans sent a letter to Newsom, a Democrat, urging him to reject creating “drug dens” that they said could potentially subject local providers to federal charges, though U.S. officials have said they are considering allowing the sites with “ appropriate guardrails.”

“Allowing people to get higher than a kite on heroin and other dangerous drugs, then turning them loose afterwards onto the streets is just crazy,” objected Republican Sen. Brian Jones.

Assembly Republican Leader James Gallagher sent his own letter, and said in a statement that Democrats who supported the bill “are actively promoting crime.”

The state Senate gave final approval to the bill on a 21-11 roll call, over GOP opposition and with eight Democrats not voting, after the Assembly advanced it in June on a 42-29 vote.

The first two publicly recognized overdose prevention sites in the United States opened in New York City in December and have been credited with intervening in more than 150 overdoses. Rhode Island approved testing similar centers for two years.

More than 2 1/2 times as many San Franciscans died of accidental drug overdoses in 2020 — a record roughly 700 people — than died from COVID-19 that year, San Francisco Mayor London Breed said earlier. She cited spiking drug overdose rates in declaring an emergency in the Tenderloin neighborhood in December.

Nationwide, drug overdose deaths increased 28.5% to more than 100,000 during the 12-month period ending in April 2021 over the same period a year earlier, according to the U.S. Centers for Disease Control and Prevention, including about 10,000 Californians.

The governing boards in each of the California jurisdictions have already asked to be included. It will remain up to them whether to go ahead and to what extent if Newsom signs the bill into law. The test programs would run until January 1, 2028.

Participating governments would have to split the cost of an independent study on the effectiveness of the program and its impact on the community, due by 2027.

But opposition crossed party lines. Critics say the sites would attract crime as users buy drugs nearby, or steal or prostitute themselves to afford the drugs.

The legislation would bar arresting or prosecuting anyone associated with the sites, including clients, for drug-related crimes.

Opponents highlight former governor Jerry Brown’s veto of a 2018 bill that would have allowed the sites in San Francisco.

“Enabling illegal and destructive drug use will never work,” wrote Brown, a Democrat. He said the proposal was “all carrot and no stick” because there was no requirement that the user undergo drug treatment.

While there is no requirement, supporters contend that employees at the sites could help users get treatment, while also helping to prevent the spread of HIV and hepatitis infections by providing clean needles. They could also have drug testing kits to check for fentanyl or other contamination.

“Although there is no silver bullet to our overdose epidemic, they are a proven strategy to reduce overdose deaths, to get people into treatment, to reduce syringe litter, and to provide people an option not to be using drugs in our public spaces — which is not healthy or appropriate for anyone involved,” Wiener said during the Senate’s final consideration.

Supporters and opponents have promoted conflicting data on whether nearly 170 such sites in Australia, Canada and Europe have been successful and whether they have encouraged nearby crime.