South Dakota joined three other states Friday that have enacted laws giving broad legal protections to faith-based organizations that refuse to place children in certain households based on their religious beliefs.

Before signing the bill, Republican Gov. Dennis Daugaard said he was concerned private child-placement agencies acting in the best interest of a child could be subject to a lawsuit when denying placement to someone in a “protected class,” such as members of the LGBT community. He hopes the legislation would forestall that.

Before Friday, Daugaard was mum on the measure that supporters say preemptively protects religious adoption and foster care agencies from things like state funding cuts, revoked licenses and denied contracts if South Dakota were to eventually ban discrimination based on sexual orientation as several other states have done.

Libby Skarin, policy director of ACLU South Dakota, said Daugaard’s decision shows South Dakotans that he cares about private agencies more than the needs of children. She said the group is exploring legal challenges to the new law and is encouraging kids and adults who feel negative impacts to step forward.

Human Rights Campaign Legal Director Sarah Warbelow said in a statement that Daugaard’s action “signals the potential of a dark new reality for the fight for LGBTQ rights.”

Religious agencies in Massachusetts, Illinois, California and Washington D.C. ended adoption services after states passed non-discrimination laws that include sexual orientation. The bill’s sponsor, Sen. Alan Solano, a Republican from Rapid City, said he doesn’t want the same thing to happen in South Dakota, though such a proposal hasn’t garnered much support in the state.

Jim Kinyon, executive director of South Dakota’s Catholic Social Services, has said that the legislation attempts to ensure the state doesn’t discriminate against faith-based organizations for their “sincerely held” beliefs.

Critics think the bill could limit child-placement in the state and could invite costly federal litigation by cementing in state law the right to discriminate against same-sex couples, single parents and even households that observe a different religion.

South Dakota joins Michigan, North Dakota and Virginia to pass so-called religious exemption bills concerning adoption and foster care. It’s the first since the 2015 U.S. Supreme Court ruling that legalized gay marriage.

Legislatures in Alabama, Texas and Oklahoma are considering similar “religious exemption” bills this year but only South Dakota has approved it.