Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A clear majority of the U.S. Supreme Court seemed inclined Wednesday to rule in favor of a Missouri Lutheran church in one of the most important legal battles in decades over the separation of church and state.

Based on their comments during courtroom argument, most of the justices appeared to favor the legal position of Trinity Lutheran Church in Columbia, Missouri. It sued the state after it was denied money from a state program to help non-profits cover their gravel playgrounds with a rubber surface made from recycled tires. The church wanted to improve the playground at its preschool and daycare center.

The state rejected the application, citing a provision in the Missouri constitution that says "no money shall ever be taken from the treasury, directly or indirectly, in any of any church, sect, or denomination of religion."

Attorney James R. Layton, lawyer for Missouri, responds to question from Justice Gorsuch in Trinity Lutheran Church v. Missouri Dept. on Natural Resources on April 19, 2017. Art Lien

Justice Stephen Breyer asked if the state, without violating the U.S. Constitution, could say, "say we'll give everyone police and fire protection, just not a church?"

Justice Samuel Alito asked if federal programs would violate Missouri's constitution by providing homeland security grants to church facilities that might be vulnerable to terror attacks.

"How can the church be disentitled to qualify for a statewide program solely because it's a religious institution?" asked Justice Elena Kagan.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The court's newest member, Neil Gorsuch, asked only a few questions of the lawyer representing Missouri challenging the state to clarify where the line should be drawn between permissible aid to churches and those that breach the wall between church and state by aiding religious programs.

At stake are bans similar to Missouri's in 38 other states that prohibit spending tax dollars to support churches. The states say they're necessary to keep the government from meddling in religious affairs.

NBC NEWS

That position seemed to find favor with only a few of the justices, including Sonia Sotomayor. "There's a long history of the nation's founders saying, we don't want to fund houses of worship," she said.

The justices seemed eager to decide the case, even though a statement late last week from Missouri's newly elected governor, Eric Greitens, at first seemed to detail the legal dispute by changing the state's policy. He said religious organizations must now be permitted to apply for and be eligible for state grants. Their request for state money will be "judged on the merits like any other applicant," a statement from his office said.

The Supreme Court directed lawyers for both sides to submit letters on how the policy change affected the case, but both said the case should go forward. During Wednesday's argument, few justices seemed concerned the case could now be moot.

In legal briefs filed earlier with the court, lawyers for the church said the state's denial of funds for the playground project violated the U.S. Constitution.

"This religious exclusion wrongfully sends a message that some children are less worthy of protection simply because they enjoy recreation on a playground owned by a church," said David Cortman of Alliance Defending Freedom (ADF), a conservative organization representing Trinity Lutheran.

He argued that government should be neutral toward religion and that blocking the church from a widely available public program "imposes special burdens on non-profit organizations with a religious identity."

That amounts to "an undeniable hostility to religion," Cortman said.

Attorney David A. Cortman addresses the Supreme Court justices in Trinity Lutheran Church v. Missouri Dept. on Natural Resources on April 19, 2017. Art Lien

Missouri responded that the constitutional provision does nothing to interfere with a church's religious activities.

"Trinity Lutheran remains free, without any public subsidy, to worship, teach, pray, and practice any other aspect of its faith however it wishes. The state merely declines to offer financial support," said James Layton, Missouri's former solicitor general.

The U.S. Constitution prevents the government from prohibiting the free exercise of religion, Layton said. "It does not guarantee churches opportunities for public financing."

A decision is expected by late June.