Democratic Sen. Scott Wiener and other supporters said arrests for loitering with the intent to engage in prostitution often rely on police officers' perceptions and disproportionately target transgender, Black and Latino women.
Critics see it as a further erosion of criminal penalties that tie the hands of police on quality-of-life issues like shoplifting and car burglaries.
Greg Burt, a spokesman for the California Family Council, and other opponents fear it's part of an eventual effort to decriminalize prostitution.
"This bill seems to be perfect if you want sex trafficking to even increase in California," he said. "This bill is really going to affect poor neighborhoods - it's not going to affect neighborhoods where these legislators live."
The bill would not decriminalize soliciting or engaging in sex work. It would allow those who were previously convicted or are currently serving loitering sentences to ask a court to dismiss and seal the record of the conviction.
The measure has passed both legislative chambers, but Wiener took the unusual step of stopping the bill from going to Newsom after the Assembly approved the measure in September with no votes to spare.
More than two dozen of his fellow Democrats in the Assembly and Senate either voted no or declined to vote.
He wanted time, Wiener said then, "to make the case about why this civil rights bill is good policy ... and why this discriminatory loitering crime goes against California values."
The Senate finally sent the bill to Newsom on Monday.
But in the nine months since lawmakers acted, concerns about crime, homelessness and the perception that major California cities are becoming more unsafe have become more acute, providing fodder for political campaigns heading into the November election.
Among the bill's supporters is San Francisco District Attorney Chesa Boudin, who voters just recalled from office in mid-term after critics mounted a campaign labeling him as soft on criminals.
Newsom, a Democrat running for reelection after easily beating back a recall last year, has said more needs to be done to address homelessness and shoplifting. Newsom's spokespeople did not immediately comment on Wiener's bill.
Burt believes lawmakers waited to send it to Newsom until after the governor defeated the recall and safely made it through the June 7 primary election.
The bill is sponsored in part by groups supporting gay and transgender rights, and Wiener said he waited to send the measure to Newsom until Pride Month, which celebrates the LGTBQ community.
"It is more important than ever to get rid of a law that targets our community," said Wiener, who is gay. "Pride isn't just about rainbow flags and parades. It's about protecting the most marginalized in our community."
The Los Angeles County Sheriff's Department, the nation's largest such agency, and the 75,000-member Peace Officers Research Association of California are among the opponents.
Both say repealing it will hinder the prosecution of those who commit crimes related to prostitution and human trafficking and make it harder to identify and assist those being victimized.
RELATED: When to cut off a customer? New CA law requires alcohol servers to take intoxication training
In a statement to lawmakers, the sheriff's department said the law is "often used to keep prostitutes from hanging around public places, business and residential communities, which can breed crime and drug use."
While the intent is good, the unintended consequences will be to benefit sex buyers, the department said.
But Wiener said the loitering law "essentially allows law enforcement to target and arrest people if they are wearing tight clothes or a lot of makeup."
Similar legislation became law in New York last year, and Wiener cast his bill as part of a larger movement to end discrimination against and violence toward sex workers.
The debate split sex workers and advocates, with the American Civil Liberties Union of California supporting it and the nonpartisan National Center on Sexual Exploitation opposing it.
Once it formally reaches his desk, Newsom will have 12 days to sign or veto the measure.
Two other related measures already are law.
A bill passed in 2016 bars arresting minors for prostitution, with the intent that they instead be treated as victims.
A 2019 bill bars arresting sex workers if they are reporting various crimes as a victim or witness.
The same law bans using possession of condoms as reason for an arrest.