VIENNA (Reuters) - The organization representing Austria’s Muslims said on Thursday it would ask the Constitutional Court to reverse a ban on headscarves in primary schools a day after it was passed in parliament.

There were an estimated 700,000 Muslims living in Austria in 2017, or roughly 8 percent of the population, partly an outgrowth of the many Turks who came to Austria to work in the 1960s and 1970s and stayed on.

Lawmakers from Austria’s two ruling parties - Chancellor Sebastian Kurz’s conservatives and the far-right Freedom Party - approved a bill including the headscarf measure late on Wednesday.

“The ban on headscarves in primary schools will only lead to segregation and discrimination of Muslim girls,” the Islamic Faith Community in Austria, a government-recognized body, said in a statement. “We will ... bring this discriminatory law before the Constitutional Court.”

Many Muslims believe their religion requires girls to wear a headscarf from puberty. Headscarves are not usually worn before then. The primary school ban will apply to girls up to around the age of 10.

The Freedom Party is outspokenly anti-Islam, while Kurz has said he wants to prevent Muslim “parallel societies” emerging that would be at odds with the mainly Catholic country’s values.

Both have taken a hard line on immigration, pledging to prevent any repeat of the influx of 2015, when Austria took in roughly 1 percent of its population in asylum seekers during the European migration crisis, including many from the Middle East.

The government announced its plans for the ban in April of last year. It also wants to ban headscarves in kindergartens, but as these are run by Austrian provinces the move will require changing the constitution, for which a two-thirds majority in the lower house of parliament is needed.

The ban in primary school was passed by a simple majority short of two-thirds.

The previous coalition of Social Democrats and Kurz’s conservatives passed a law banning face coverings including Muslim full-face veils in public spaces, but women and girls are free to wear regular hijab.

It considered banning teachers from wearing headscarves but that plan was dropped after a debate over religious symbols in schools such as the Catholic crosses that still hang on many classroom walls.