The highest court in the nation ruled that the state of Missouri had violated the constitutional rights of a church by disqualifying it from receiving a public benefit simply on the basis that it is a church.

Trinity Lutheran Church, located in Columbia, MO, operates a preschool and daycare center, had applied for a state grant in 2012 to resurface its pea gravel playground with the smoother and safer surface made with recycled tires.

Though the church had ranked fifth among the 44 applicants and the state had granted 14 of them participation in the program, Trinity was notified that the state cannot give them the grant due to a policy prohibiting them from granting state money to church-controlled organizations.

Ultimately, the Supreme Court ruled 7-2 on June 26 that the state had discriminated against the church.

“The Department’s policy expressly discriminates against otherwise eligible recipients by disqualifying them from a public benefit solely because of their religious character,” the Supreme Court ruling states, referring to Missouri’s Department of Natural Resources which launched the Scrap Tire Program. “The Department’s policy puts Trinity Lutheran to a choice: It may participate in an otherwise available benefit program or remain a religious institution.”

“The express discrimination against religious exercise here is not the denial of a grant, but rather the refusal to allow the Church — solely because it is a church — to compete with secular organizations for a grant,” it added.

Chief Justice John Roberts said that disqualifying Trinity on the basis of it being a church, though it was qualified on all other measures, is “odious to our Constitution.”

Though the since newly elected Missouri Governor Eric Greitens has since changed the state law to allow religiously affiliated organizations to be able to apply for the Scrap Tire Program, the Supreme Court was asked to still consider the case. Supporters of the church argued that the ruling would have implications for whether religious institutions would be able to gain access to other public benefits from states, such as programs that protect schools from violence or terrorism.

Justices Sonia Sotomayor and Ruth Ginsburg dissented from the majority opinion. Sotomayor, who wrote the dissent and read a portion of it in court, argued that this “case is about nothing less than the relationship between religious institutions and the civil government — that is, between church and state.”

The Supreme Court’s decision “profoundly changes that relationship,” Sotomayor wrote, “by holding, for the first time, that the Constitution requires the government to provide public funds directly to a church.”

Meanwhile, advocates for religious freedom celebrated the victory. Russell Moore, president of the Southern Baptist Convention’s Ethics and Religious Liberty Commission (ERLC), said the case “will have profound implications for years to come.”

“The court did the right thing,” Moore said, “because it recognized the difference between a government supporting a religion and a government treating all people fairly, including religious people.”