Germany’s Federal Constitutional Court ruled Friday that a ban on teachers wearing headscarves is not compatible with religious freedom and overturned its previous ruling. The decision comes after a lawsuit was filed by two female Muslim teachers from North Rhine-Westphalia, who wanted to wear head coverings while teaching.

State authorities had earlier said that the teachers were violating the law, which forbade any religious symbols or actions. Such actions, according to the authorities, threatened harmonious co-existence at schools, Deutsche Welle reported. One of the teachers was dismissed from the job while the other was given a warning in written.

The ruling from Germany’s highest court now reportedly says that any such symbol or action must pose a "concrete danger" to be forbidden under the law. The court further said that the ban was an intrusion on the self-identity of the teachers.

A school would need to show "not only an abstract but a sufficiently specific risk" to justify the ban, the Associated Press reported, citing the court. 

The court also reportedly said that a clause, which excepted "Christian and Western educational and cultural values or traditions" from the ban, had violated the constitution’s protection against discrimination on religious grounds.

The federal court's ruling in the case will now also apply to other states that have headscarf bans, the AP reported.

The ban had been introduced in 2003, when the court ruled that schools had the power to ban teachers from wearing headscarves if the states had a corresponding law. Many schools in different states had used the law to ban headscarves, Deutsche Welle reported.