Updated

The Supreme Court on Tuesday struck down a ban on taxpayer funding for religious schools, in a narrow but significant win for the school choice movement.

In the 5-4 ruling, authored by Chief Justice John Roberts, the court essentially backed a Montana tax-credit scholarship program that gave residents up to a $150 credit for donating to private scholarship organizations, helping students pay for their choice of private schools. The state's revenue department made a rule banning those tax-credit scholarships from going to religious schools before the state's supreme court later struck down the entire program.

SUPREME COURT JUSTICES CLASH OVER MAJOR SCHOOL-CHOICE CASE

“A State need not subsidize private education. But once a State decides to do so, it cannot disqualify some private schools solely because they are religious," Roberts wrote in the court's opinion.

Under the program, a family receiving a scholarship originally could use it at any “qualified education provider,” which the court’s opinion noted means “any private school that meets certain accreditation, testing, and safety requirements." The Montana Department of Revenue, citing the state constitution, then changed the definition of "qualified education provider" to exclude those "owned or controlled in whole or in part by any church, religious sect, or denomination."

That decision, which the state attorney general disagreed with, was based on a "no-aid" clause in the state's constitution, which bars the state from giving aid to schools “controlled in whole or in part by any church, sect, or denomination."

Parents of children attending a religious private school sued, and a lower court ruled in their favor, holding that the tax credits did not violate the state constitution because they were not appropriations made to religious institutions. The state supreme court overruled that decision and ordered the entire program to be scrapped.

SUPREME COURT RULES CFPB HEAD CAN BE FIRED FOR ANY REASON, IN BLOW TO AGENCY CREATED UNDER OBAMA

"I feel that we're being excluded simply because we are people of religious background, or because our children want to go to a religious school," Kendra Espinoza, a lead plaintiff in the case, said after the U.S. Supreme Court heard oral arguments in the case in January. "We're here to stand up for our rights as people of faith to have the same opportunities that a secular schoolchild would have."

Roberts noted that the Montana scholarship program in no way violated the U.S. Constitution, noting that the Supreme Court has "repeatedly held that the Establishment Clause is not offended when religious observers and organizations benefit from neutral government programs." The chief justice pointed out that neither side in the case disputed this.

What was at issue in the case is the First Amendment's Free Exercise Clause -- which applies to the states through the Fourteenth Amendment -- which forbids laws that prohibit the free exercise of religion. Roberts said that the Montana Supreme Court erred when they failed to recognize that the state constitution's "no-aid" clause violated the First Amendment.

SUPREME COURT RULES AGAINST TRUMP ADMINISTRATION BID TO END DACA PROGRAM

"When the Court was called upon to apply a state law no-aid provision to exclude religious schools from the program, it was obligated by the Federal Constitution to reject the invitation," Roberts wrote.

In a dissenting opinion, Justice Ruth Bader Ginsburg argued that there was no constitutional violation because the program ended up being shut down entirely, leaving families from all schools in the same position. Justice Sonia Sotomayor argued in her own dissent that the Montana state court decision was based on state law having nothing to do with the Free Exercise Clause. Roberts rejected those arguments because “[t]he program was eliminated by a court, and not based on some innocuous principle of state law.”

In a third dissent, Justice Stephen Breyer -- joined by Justice Elena Kagan -- argued that while Montana's aid program's inclusion of religious schools may not have been forbidden by the First Amendment's Establishment Clause, it was not required by the Free Exercise Clause as Roberts' claimed it was.

CLICK HERE TO GET THE FOX NEWS APP

Tuesday's ruling is a victory for school choice proponents and some conservative religious groups who had challenged the provision in court. Montana's program was similar to many across the U.S., and other states have proposed tax-credit scholarship programs but not passed them due to confusion about their legality.

Roberts once again served as the swing vote in a 5-4 decision. This time, he joined his fellow justices in the conservative wing of the court. On Monday, Republicans railed against him for siding with the liberal contingent in a 5-4 case that struck down a Louisiana law that place restrictions on abortions by requiring that those who perform the procedures have admitting privileges at a nearby hospital. He was also the deciding vote in a recent ruling against the Trump administration's attempt to rescind DACA.

Fox News' Tyler Olson contributed to this report.