INDIANAPOLIS — A lawsuit filed by a teacher who was fired from his job at a Catholic high school in Indianapolis for being in a same-sex marriage can proceed, a state appeals court ruled.

A panel of the Indiana Court of Appeals ruled unanimously Tuesday that a Marion County court erred in dismissing Joshua Payne-Elliott’s lawsuit against the Archdiocese of Indianapolis. The ruling reverses that decision and sends the case back to the lower court, The Indianapolis Star reported.

Payne-Elliott had worked for 13 years as a world language and social studies teacher at Cathedral High School. He was fired in June 2019 after the archdiocese mandated that all Catholic schools under its purview enforce a morality clause barring employees from entering into same-sex marriages.

Payne-Elliott married Layton Payne-Elliott, a teacher at Brebeuf Jesuit Preparatory School, in 2017.

The couple has been at the center of a fight between their schools and the archdiocese, which directed the schools to fire both men. Brebeuf did not comply with the directive, to which the archdiocese responded by attempting to strip Brebeuf of its status as a Catholic institution.

Payne-Elliott filed a lawsuit in July 2019, alleging that the archdiocese illegally interfered with his contractual and employment relationship with Cathedral High School by causing the school to terminate him.

An attorney for LGBT rights group Lambda Legal, which had filed a brief supporting Payne-Elliott’s lawsuit, praised the appeals court ruling, calling it “wonderful.”

“Joshua Payne-Elliott just wanted the chance to make his case in court. The Indiana Court of Appeals today ruled that he will get that opportunity,” Greg Nevins, Lambda Legal’s senior counsel, said in a statement Tuesday.

The archdiocese asked the lower court in August 2019 to dismiss Payne-Elliott’s lawsuit, citing the First Amendment as a defense.

An attorney representing the archdiocese in the case said Wednesday in a statement that the “Supreme Court has repeatedly upheld the constitutional right of Catholic schools to hire teachers who fully support the schools’ Catholic mission.”

“Today’s ruling doesn’t address this core issue, and we’re confident that when the courts finally do, they will respect this fundamental right,” said Luke Goodrich, the vice president and senior counsel at Becket, a legal organization focused on religious liberty.