A California Republican claims Democratic-backed legislation aimed at protecting underage sex trafficking victims actually pushes minors into prostitution.

"Beginning on Jan. 1, prostitution by minors will be legal in California. Yes, you read that right," Assemblyman Travis Allen, whose district covers parts of Orange County, wrote Thursday in the conservative D.C. publication the Washington Examiner.

Allen's attack on the "terribly destructive legislation" has lit up social media — but the intention of the law is not as alarming as he suggests, its supporters say.

Senate Bill 1322, which was signed into law by Democratic Gov. Jerry Brown in September, goes into effect on Sunday.

"So teenage girls (and boys) in California will soon be free to have sex in exchange for money without fear of arrest or prosecution," Allen wrote.

Read my oped that ran in the Washington Examiner today discussing the many harmful California Democrat policies... https://t.co/eJVzKbPlDa — Travis Allen (@JoinTravisAllen) December 29, 2016

SB 1322, he added, "bars law enforcement from arresting sex workers who are under the age of 18 for soliciting or engaging in prostitution, or loitering with the intent to do so."

And that's true — the law does state that minors won't be treated as criminals if they are caught under such circumstances. But state Democrats say that distinction was necessary so that the children aren't being blamed or punished for their situation.

They are instead to be treated as victims who can be placed into a safe environment by the Department of Social Services, keeping them out of the criminal justice system and potentially off the streets again forced into prostitution, said state Sen. Holly Mitchell, who introduced SB 1322.

In his op-ed, Allen acknowledged that Democrats are "sincere in their belief that decriminalizing underage prostitution is good public policy that will help victims of sex trafficking." But he said SB 1322 is "misguided" because it would theoretically allow pimps who exploit children to continue doing so because the children aren't being adequately removed.

"Simply put, more time on the street and less time in jail means more money for pimps, and more victims for them to exploit," Allen wrote.

Allen could not be reached Friday for further comment.

The law's backers deny that children won't be helped, and say the alternative if they are arrested of juvenile hall again victimizes them.

“The law is supposed to protect vulnerable children from adult abuse, yet we brand kids enmeshed in sex-for-pay with a scarlet ‘P’ and leave them subject to shame and prosecution,” Mitchell said in September.

I denounce false claims made by Republicans on my bill #SB1322 that decriminalizes sexually exploited minors pic.twitter.com/9r32LlDmM0 — Holly J Mitchell (@HollyJMitchell) December 31, 2016

She said in a statement Friday to NBC News that it is a "factually incorrect assertion that my bill ... ties the hands of the police."

Currently, anyone caught soliciting can be charged with a misdemeanor that might include probation, jail time or a fine.

California Attorney General Kamala Harris, who as a prosecutor once specialized in child sexual assault cases, addresses the Domestic Human Trafficking symposium in Los Angeles on April 25, 2014. Damian Dovarganes / AP, file

While minors will be exempt from criminal charges under the new law, anyone caught engaging in acts with them will still be subject to prosecution since sex with a minor is considered statutory rape.

Various district attorneys' offices in the state have expressed a similar apprehension toward the law —but some say it's because the state just isn't ready to provide adequate services.

“Right now, service groups are struggling with what they have in place — there [are] just not enough resources,” Jane Creighton, coordinator of the human trafficking unit at the Los Angeles County District Attorney's Office, told the Los Angeles Times in August. “I am not saying these bills should never pass. But we are not ready for them right now.”