(CNN) Michigan settled a lawsuit that challenged the state's practice of contracting with foster care and adoption agencies that refused to provide services that conflicted with their religious beliefs.

As part of the settlement, the state agreed to end contracts with agencies that discriminate against same-sex couples or LGBTQ individuals that "may otherwise be qualified foster care or adoptive parents" for children in state custody.

However, under the terms of the agreement, the state cannot take adverse action against agencies engaged in private actions -- such as private-adoption or direct-placement services -- that are not performed on the state's behalf.

The settlement is the latest inflection point in a nationwide debate over religious freedom in the child welfare system. Earlier this year, the Trump administration granted a waiver that lets federally funded child welfare agencies in South Carolina refuse to perform services that conflict with their beliefs.

Before the settlement, Michigan was one of nine states that let state-contracted child welfare agencies act in accordance with their religious beliefs, even if those beliefs meant refusing to work with same-sex couples.

Read More