The Supreme Court on Thursday denied a request to force the city of Philadelphia to reinstate a foster care agency's contract that ended after the agency refused to place children with gay couples.

In March, Philadelphia stopped referring children to two foster care providers after learning that they had refused to license same-sex couples to be foster parents.

Catholic Social Services (CSS) sued the city, arguing that its right to free exercise of religion and free speech were being violated.

CSS turned to the Supreme Court after a federal court in Pennsylvania sided with city officials and refused to issue a preliminary injunction ordering Philadelphia to resume referrals of cases to CSS.

On Thursday, the high court also refused to issue a preliminary injunction as the case continues through the courts.

In its two paragraph order, the court said that three justices – Clarence Thomas, Samuel Alito and Neil Gorsuch – would have granted the agency's request. Five of the court's nine justices are needed to grant an injunction.

CSS said that the decision would force its foster care program to close.