The Supreme Court in Spain has stripped the Diocese of Canarias of the right to determine the qualifications of teachers hired to teach the Catholic faith.

The court ruled this week in favor of a woman who is living with another man outside of marriage, whom the Diocese said was incompetent to teach religion.

According to the court ruling, the diocese would have to give back pay totaling $12,888 to Maria del Carmen Galayo.

Galayo, who is still married but is separated and in new union outside the Church, was let go by the diocese, which said her situation of adultery was not compatible with the moral principles the Church publicly requires for teaching religion to minors.

With the support of the local media, Galayo filed a lawsuit claiming Church officials had “unduly interfered in her private life,” and demanded not only economic compensation but also that she be given back her teaching position.

The Court ruled against an appeal by the diocese of a lower court ruling, which means the diocese will have to pay Galayo for lost wages. The diocese could appeal to the Constitutional Court to retain the right to refuse to allow Galayo to return to her teaching post.