HUNTINGTON BEACH (CBSLA.com) — An Orange County lawmaker says a controversial new law set to take effect on Jan. 1 will effectively make child prostitution legal in California, but supporters argue he and other critics simply haven’t understood it correctly.

Senate Bill 1322 , which was signed into law in September, makes solicitation and loitering with the intent to commit prostitution misdemeanors that do not apply to children under the age of 18.

SB 1322 also gives law enforcement officials the authority to take sexually exploited children into temporary custody if it’s determined that not doing so would pose an immediate threat to a child’s health or safety.

The bill’s sponsor, Sen. Holly Mitchell (D-Los Angeles), said SB 1322 “decriminalizes prostitution charges for minors” and regards anyone under the age of 18 who might previously have been charged with criminal prostitution as victims of sex trafficking, making them eligible for treatment rather than prosecution.

While SB 1322 still allows for minors to be placed in temporary custody under specific conditions, including for soliciting lewd or unlawful acts in restrooms and other public areas, or if a child is found intoxicated in a public place, Assemblyman Travis Allen (R-Huntington Beach) says he worries the law will ultimately encourage sex trafficking of minors.

In an editorial written Thursday, Allen wrote “teenage girls (and boys) in California will soon be free to have sex in exchange for money without fear of arrest or prosecution.”

“Immunity from arrest means law enforcement can’t interfere with minors engaging in prostitution — which translates into bigger and better cash flow for the pimps,” he said. “Simply put, more time on the street and less time in jail means more money for pimps, and more victims for them to exploit.”

But Allen also acknowledged child prostitution will still be illegal in California under SB 1322, and pimping and pandering will still be against the law “whether it involves running adult women or young girls.”

Jane Creighton, who coordinates the Los Angeles County district attorney’s office human trafficking unit, told the Los Angeles Times earlier this year that law enforcement officers need the authority to arrest underage sex workers since many of them “do not want to accept” treatment and other services.

According to Mitchell, however, SB 1322 requires law enforcement to “immediately report allegations of commercial sexual exploitation involving juveniles to agencies charged with protecting and counseling them.” Under the law, courts would still be responsible for overseeing the care that trafficked youths receive while they remain underage in the absence of responsible parents or guardians, Mitchell said.

The law appears to largely echo statements from the U.S. Department of Justice, which also recommended treating children involved in prostitution as victims rather than criminals.

Social media’s reaction to the bill was mixed, with some pointing out a subtle but important distinction in SB 1322 between minors being arrested for solicitation and minors being taken into “temporary custody under limited circumstances.”

When people say California Democrats legalized child prostitution with SB 1322: pic.twitter.com/Qoj5Uh2PJO — James Russell (@JamesRussell88) December 30, 2016

CA SB1322, does not make Child prostitution legal but it does make it easier/sentences lighter for adults engaging. CA should be ashamed! pic.twitter.com/zb93wywClb — Mike Doughty (@realmikedoughty) December 30, 2016

More proof California is out of their mind#SB1322 — AtotheV (@Aaron2178) December 30, 2016

California Democrats being attacked for protecting trafficked children shows me that American conservatives are the dumbest people on Earth. — Joshua David 🚯 (@bathroompolice) December 30, 2016

Please humor me & allow me to refute some lies you have been told. SB1322 did NOT "make child prostitution legal in CA" 1/cont… — Liberty (@LibertyBelleIII) December 30, 2016

Ppl approaching #SB1322 as if only way to prostitute minors is w/ adult pimp. Let me tell you as someone who served time in Juvie, no. — Hope McKenna (@HopeStillFlies) December 30, 2016