SACRAMENTO, Calif. (AP) — A new law aims to stop other states from punishing children who come to California for transgender surgeries and other gender-affirming care, a move that will intensify conflicts between Democratic Gov. Gavin Newsom and other Republican governors amid the country’s escalating culture war.

Newsom signed the law on Thursday, but it won’t take effect until January. It is designed to stop Texas and other conservative states from removing children from parents who allow them to receive “gender affirming” health care, defined as “medically necessary health care that respects the gender identity of the patient, as experienced and defined by the patient.”

That would include hormone therapy to suppress secondary sex characteristics and other treatments “to align the patient’s appearance or physical body with the patient’s gender identity.”

The law will block out-of-state subpoenas, stop health providers from sharing information with out-of-state entities related to gender-affirming care. And it would give California courts authority to make an initial child custody determination if the child is in California for the propose of obtaining gender-affirming care.

The law was in part inspired by Texas Republican Gov. Greg Abbott, who has treated gender-affirming care as child abuse and ordered investigations of families who allowed it. A Texas judge has temporarily blocked the state from doing that, but the case is on appeal.

“As so many states work to erase trans kids and criminalize their families, California must always have their backs,” state Sen. Scott Wiener said. ”California is forcefully pushing back against the anti-LGBTQ hatred spreading across parts of our nation. The rainbow wave is real, and it’s coming.”

The law has already inspired similar proposals in at least 19 other states, Wiener said. But it’s not clear if the law will survive a challenge in court. The U.S. Constitution in general requires states to give “full faith and credit” to other state’s laws. But it also guarantees people the right to travel to other states.

“At this time, the interplay between these two constitutional provisions and the constitutionality of the other states’ laws have yet to be determined, so it is unclear whether this bill will run afoul of the constitution,” legislative staffers wrote in an analysis of the bill before Newsom signed it into law.

Wiener’s office believes the law is constitutional because it does not change the requirement that California recognize valid court judgments issued in other states. They said the law limits California courts from enforcing subpoenas issued by out-of-state courts and protects information about gender-affirming care provided in California. The law does block extradition to other states, but only to “the fullest extent permitted by federal law,” said Catie Stewart, a spokesperson for Wiener’s office.

The law continues California Democrats’ plan to push back against laws they don’t like in other conservative states. Earlier this week, Newsom signed laws to make California a sanctuary for women in other states seeking abortions now that the U.S. Supreme Court has overturned Roe v. Wade.

Newsom signed the law because he said he was taking a stand for parental choice, saying “parents know what’s best for their kids, and they should be able to make decisions around the health of their children without fear.” That elicited cries of hypocrisy from some critics, who note Newsom has ordered all school children to receive the COVID-19 vaccine — an order that has been delayed until at least next summer.

The California Family Council opposed the law. The conservative group fears the law could be used to entice children to California against their parents’ wishes.

“By signing this extreme bill, Gavin Newsom is telling all parents across the country that he knows what’s best for their children,” said Jonathan Keller, the group’s president. “Mothers and fathers in every state should demand their elected representatives push back against this unconstitutional assault on parental rights.”