TRENTON, N.J. (CBSNewYork/AP) — A court has ruled that New Jersey cannot give $11 million in grants to two religious schools.

The state appeals court ruled Thursday that the $10.6 million grant to Beth Medrash Govoha yeshiva in Lakewood and $645,323 to the Princeton Theological Seminary are unconstitutional.

The $10.6 million to Beth Medrash Govoha was granted for a library, research center and new academic space in an existing building. Princeton Theological Seminary was granted the money to upgrade library information technology and a training room and to remodel a conference room.

The American Civil Liberties Union and Americans United for Separation of Church and State had challenged the grants, made as part of $1.3 billion in grants in April 2013.

The lawsuit claimed the grants violated the state constitution’s prohibitions against using taxpayer money for places of worship and giving preference to a religion, as well as violate its stipulation that public money be used for public purposes. In addition, the suit stated the grant awarded to the Beth Medrash Govoha, an all-male Talmudic studies center, violates state law against discrimination based on gender.

New Jersey officials argued that the grants were okay because they were meant to pay for buildings and equipment, not worship or ministries.

Thursday’s ruling sets a precedent for New Jersey when it comes to the determining what institutions fall under the qualifications of a “ministry.”

The court said in its ruling that it doesn’t mean the state can’t give money to religious-affiliated schools that have a broader sectarian mission.

(TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)