A German federal court has ruled that church-run institutions are within their rights to refuse to allow Muslim employees to wear headscarves at work.

The Federal Labor Court ruled Wednesday on a case brought by a former nurse at a Protestant church-linked hospital.

In 2010, the woman offered to return to work after maternity and sickness leave totaling four years and said she wanted to wear her headscarf at work. The hospital said no, and the woman went to court to seek compensation.

The federal court ruled that wearing a headscarf as a religious symbol isn't compatible with a contractual obligation to "neutral behavior" in a church-run facility. But it sent the woman's case back to a lower court, citing doubts over whether the hospital was technically a church institution.