FILE - In this Nov. 10, 2020, file photo the sun rises behind the U.S. Supreme Court in Washington. (AP Photo/Alex Brandon, File)

WASHINGTON (AP) — The Supreme Court ruled on Thursday that the city of Philadelphia violated the Constitution by limiting its relationship with a Catholic foster care agency over the group's refusal to certify same-sex couples as foster parents.

The justices came down unanimously against Philadelphia and for Catholic Social Services.

“The refusal of Philadelphia to contract with CSS for the provision of foster care services unless it agrees to certify same-sex couples as foster parents cannot survive strict scrutiny, and violates the First Amendment,” Chief Justice John Roberts wrote.

Catholic Social Services is affiliated with the Archdiocese of Philadelphia. The agency has said that its Catholic beliefs prevent it from certifying same-sex couples as foster parents.

Philadelphia learned in 2018 from a newspaper reporter that the agency would not work with same-sex couples. The city has said it requires that the two dozen-plus foster care agencies it works with not to discriminate as part of their contracts. The city asked the Catholic agency to change its policy, but the group declined. As a result, Philadelphia stopped referring additional children to the agency.

Catholic Social Services sued, but lower courts sided with Philadelphia.

[Why do Catholics make up a majority of the Supreme Court?]

The latest from america

Sister Percylee Hart, principal of the Olympian's alma mater, has made a habit of encouraging every student to achieve their best.
Kerry WeberAugust 04, 2021
(iStock/PeopleImages)
Summer is a good season to take stock of how our dependence on technology can change us. Here are seven steps for seeing your smartphone more clearly.
Jim McDermottAugust 04, 2021
Through the mystery of this sacrament Jesus reveals something inherent about himself and about our life in him.
Terrance KleinAugust 04, 2021
Only 38% of Catholics surveyed had heard of McCarrick, according to a recent survey commissioned by America Media and conducted by the Center for Applied Research in the Apostolate.
Kerry WeberAugust 04, 2021