The Supreme Court on Monday said it would consider whether religious adoption agencies can turn away same-sex parents, potentially carving out a means for groups that rely on taxpayer funds to discriminate against LGBTQ people.

The case of Fulton v. Philadelphia presents a major opportunity for religious conservatives to win a ruling with national consequences that would let private organizations sidestep civil rights policies while competing for funds on equal footing with secular organizations.

The dispute began with Philadelphia’s Department of Human Services, which, like similar agencies in cities nationally, seizes children without safe homes, such as kids who are abused or neglected, and places them with foster parents. The Philadelphia department works with — and funds — several private groups that assist, including Catholic Social Services, run by the Archdiocese of Philadelphia.

In March 2018, nearly four years after the Supreme Court found same-sex couples have a constitutional right to marry, city officials saw an article in the Philadelphia Inquirer that said Catholic Social Services (CSS) had a policy of categorically refusing service to same-sex couples seeking to become foster parents.

After the city cut off parts of the CSS contract for placing children in homes — but continued to fund other parts CSS, such as group homes — the religious group sued the city. CSS claimed its First Amendment rights to free exercise were being violated and the nondiscrimination rule was unfairly being applied to them as a form of religious hostility.

“As a Catholic agency,” the group’s July petition to the Supreme Court said, “CSS cannot provide written endorsements for same-sex couples which contradict its religious teachings on marriage. The mayor, city council, Department of Human Services, and other city officials have targeted CSS and attempted to coerce it into changing its religious practices.”

A federal district court, and then a federal appeals court, had ruled against the adoption agency, finding that the city’s contract that banned discrimination on the basis of sexual orientation was legal and applied neutrally — for instance, the rules were identical for religious groups and secular contractors alike.

The city added in a Supreme Court brief in October it has banned discrimination based on sexual orientation for several years. “The City has never allowed contractors to turn away potential foster parents based on a protected characteristic,” the filing said. “Although this longstanding policy applies to all City contractors — and although the City has long contracted with Catholic Social Services, and continues to do so for a range of other child-welfare services — CSS contends that the City’s decision to enforce this policy against it reflects religious hostility.”

When the Third Circuit Court of Appeals agreed with the city, it found CSS “failed to make a persuasive showing that the City targeted it for its religious beliefs, or is motivated by ill will against its religion, rather than sincere opposition to discrimination on the basis of sexual orientation.”

The case is among several battles between the religious right and LGBTQ advocates since same-sex marriage was legalized by states and courts. Religious conservatives insist they reserve a constitutional right to withhold endorsement of those marriages by recusing themselves from helping adoptions, declining medical services, and refusing wedding-related goods and services — even when state laws ban anti-LGBTQ discrimination.

The First Amendment’s rights to free speech, religious exercise, and religious expression mean a person cannot be compelled to perform tasks or make products, religious conservatives contend. They were emboldened by the 2017 case of Trinity Lutheran Church of Columbia v. Comer, where a Missouri church successfully argued at the Supreme Court for a government grant to refurbish its playground. Religious conservatives also won a narrow victory at the Supreme Court in 2018 for a Colorado baker who turned away a gay couple.

At the federal level, in 2019, the Department of Health and Human Services’ Office of Civil Rights also said it would allow faith-based foster care and adoption agencies receive federal funds, even if they refuse same-sex parents.

The city’s case is assisted by the Support Center for Child Advocates and Philadelphia Family Pride, which is represented by the ACLU.

In addition to Catholic Social Services, plaintiffs include Sharonell Fulton and Toni Simms-Busch, two women who support the adoption agency. Their case is being argued by lawyers at the Becket Fund, which represented Hobby Lobby in a Supreme Court case that found employers could refuse to pay for contraception under Obamacare.