HUNTINGTON BEACH ( — 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.

READ MORE: Simone Biles Wins Bronze In Balance Beam After Withdrawing From Other Tokyo Olympics Events

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.”