The New Mexico Supreme Court ruled on Thursday to uphold a book-lending program that gives school children at public and private schools equal access to state-approved textbooks.

The Becket law group, which represented the New Mexico Association of Non-public Schools, called the decision a victory for low-income students and against religious discrimination.

"In shutting the book on religious discrimination, the New Mexico Supreme Court has opened access to quality textbooks for all students," Eric Baxter, vice president and senior counsel at Becket, said in a statement on the ruling.

"All kids deserve an education free from discrimination," he added.

When it comes to public education, New Mexico consistently ranks poorly in comparison to other states. A 2017 report from Education Weekly ranked them second-to-last among the 50 states for quality of public education. A U.S. News report from the same year put them in last place.

Becket said in their statement that stopping the textbook loan program had most disadvantaged minority and low-income students living in rural areas.

In its Thursday, the state Supreme Court sided with Becket, and ruled that the textbook program "furthers New Mexico's legitimate public interest in promoting education and eliminating illiteracy."

In 2011, two parents challenged the 80-year-old textbook lending program. They claimed that New Mexico's state constitution bars education funds from being used "for the support of any sectarian, denominational or private school, college or university." This language is commonly known as a "Blaine Amendment."

A 2015 New Mexico Supreme Court decision, Moses v. Ruszkowski, sided with the plaintiffs and ended nonpublic school students' participation in the program.

In May, Becket challenged the ruling's reliance on the Blaine Amendment, saying that the 19th century law was "originally designed to disadvantage New Mexico's native Catholic citizens" and "was all about anti-Catholic animus."

Becket appealed the case to the Supreme Court, which urged the Supreme Court of New Mexico to reconsider it in light of a ruling on a similar case in 2017, Trinity Lutheran Church v. Comer, which granted public funds to help update a Lutheran school playground.

In their Thursday statement, Becket added that the Blaine Amendment has historically been used for discrimination in everything from trying "to stop children with disabilities from attending schools that best meet their needs, to prevent schools from making their playgrounds safer, to stop food kitchens from helping the poor, and to close service providers that help former prisoners successfully reintegrate into society."

Becket said that the state Supreme Court acknowledged on Thursday the Blaine Amendments' "malicious history, noting that 'New Mexico was caught up in the nationwide movement to eliminate Catholic influence from the school system.'"

"New Mexico's kids are better off today because the New Mexico Supreme Court rejected 19th Century religious discrimination," John Foreman, state director of the New Mexico Association of Non-public Schools, said in a statement on the ruling.

The court's ruling has effectively reinstated the textbook lending program.