Germany's Constitutional Court has struck down as unconstitutional a law that banned the use of Islamic headscarves for teachers with no exception.

The court's decisions follows a suit brought by two female Muslims from the North Rhine-Westphalia state, who wanted to cover their heads while in public for religious reasons, AP reported.

One of the teachers was fired, while the other received a written warning after wearing the headscarf, defying the then existing law that banned the use of headscarves for teachers on grounds they could represent a threat to harmonious co-existence at schools.

In its new ruling, the court decided an absolute ban on the use of the headscarf for teachers was against the right of religious freedom and that a school would need to show "not only an abstract but a sufficiently specific risk" to justify a ban. According to the ruling, the ban represented an intrusion on the teachers' self-identity.

The court's decision will apply to Westphalia and other German states that have implemented a total ban on headscarves in school.

The ruling also overturned another clause of the same Westphalia law, which allowed only manifestations "of Christian and Western educational and cultural values or traditions" at school. The court said this exception privileged Christian symbols over those of other religions.