The European Court of Justice (ECJ) ruled on Tuesday that the head doctor of a Catholic Church-run clinic in Düsseldorf had lost his job due to potential "hidden discrimination" after he was fired for getting married a second time.

The ruling, which came after the case had worked its way through the German courts over three years, could influence the relationship between the German state and the church-run employers. Currently, the German constitution grants the church to right to fire employees who breach its religious laws.

Divorced and remarried

In the case, the ECJ was looking at EU law to see whether church-related institutions were allowed to impose stricter requirements on their Catholic employees than on those who were members of other religions or non-religious.

Read more: Top EU court rules church job ads open to discrimination scrutiny

The doctor in question had married within the Catholic Church. He later divorced his wife and then remarried a new partner in a civil ceremony in 2008.

His clinic, the Catholic St. Vinzenz Hospital in Düsseldorf, which belongs to the archdiocese of Cologne, considered his second marriage to be invalid according to church prescripts and said the doctor had violated the religious loyalty requirements of his job. The clinic subsequently fired the doctor in 2009.

The doctor argued that he would not have been dismissed, had he not been Catholic.

Germany's Federal Labor Court turned to the ECJ for advice on legal compatibility in the case

Read more: Catholic institutions can fire staff for breaking rules, says German court

The case proceeded through various levels of the German judicial system, until 2016, when the Federal Labor Court turned to the ECJ to see whether the doctor's dismissal on these terms was in agreement with EU law.

The German justice system will make the final ruling in the dismissal case.

cmb/kms (dpa, AFD, epd)

Each evening at 1830 UTC, DW's editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.