Texas Governor Greg Abbott signed a bill on Thursday that would allow religious child welfare agencies to operate according to its religious beliefs without fear of penalty.

House Bill 3859 was passed in both chambers of the state legislature in May, with a 93 to 49 vote in the House, and a 21 to 10 vote in the Senate.

The bill has been controversial. Supporters said that the bill is a necessary measure to protect faith-based agencies from facing penalty for adhering to their religious conscience, such as by refusing to place children in certain potential foster families, or placing children in religious schools. Opponents argued this bill would give religious agencies the license to discriminate against individuals such as those in the LGBT community.

“It is the intent of the legislature to maintain a diverse network of service providers that offer a range of foster capacity options and that accommodate children from various cultural backgrounds,” the bill text reads.

“To that end, the legislature expects reasonable accommodations to be made by the state to allow people of diverse backgrounds and beliefs to be a part of meeting the needs of children in the child welfare system,” the bill goes on. “Decisions regarding the placement of children shall continue to be made in the best interest of the child, including which person is best able to provide for the child’s physical, psychological, and emotional needs and development.”

However, opponents argue that the law’s intent was “never about the best interests of Texans or of children, but about forwarding a political agenda to codify the permission to discriminate against LGBTQ Texans into state law,” as GLAAD’s president Sarah Kate Ellis put it in a statement.

House Rep. James Frank, who sponsored the bill, rejected claims that the bill is discriminatory, as foster families will always have options other than religious agencies from which to receive foster children.

The bill “seeks to protect faith-based providers from adverse actions for exercising their deeply held religious beliefs,” Frank said.

“At the same time, it requires the Department of Family and Protective Services to ensure alternative providers are present to offer any service denied for reasons of sincerely held religious beliefs,” he added. “Not one foster parent/family who wants to provide a home for our kids will be denied from doing so. Not one.”