Jeremiah Galus, legal counsel with Alliance Defending Freedom, said the First Amendment "plainly protects a church's freedom to decide who serves as its religious leaders, as the U.S. Supreme Court acknowledged only five years ago."

He was referring to the high court's 2012 decision in Hosanna-Tabor v. EEOC affirming a "ministerial exception" to anti-discrimination laws, meaning the Lutheran school and church in that case could not be sued for firing an employee the church classified as a minister.

The 2nd Circuit in its ruling said the ministerial exception "bars Fratello's employment?discrimination claims against the archdiocese, the church and the school, all of which are religious groups within the meaning of the ministerial exception."

"Although her formal title -- 'lay principal' -- does not connote a religious role, the record makes clear that she served many religious functions to advance the school's Roman Catholic mission," the court said.

Those functions included, it said, working closely with teachers to carry out the school's religious mission, leading daily prayers over the loudspeaker, supervising Masses attended by students, and overseeing "teachers' integration of lessons about Catholic saints and religious values" the curriculum.

In a statement issued after the court ruling, Mercedes Lopez Blanco, an archdiocesan spokeswoman, said: "A Catholic school is nothing without a Catholic leader. The principal is an important minister of the faith, who holds a crucial position of passing on our values to the next generation. We are grateful students at St. Anthony's can continue receiving the Catholic education they came for."