A headscarf ban for pupils in Austrian primary schools has been ruled discriminatory and illegal by the country's constitutional court.
The court also found the law only targeted Islamic pupils after the government admitted Sikh patka head coverings and Jewish kippahs would not be affected by the ban.
The law prevented girls younger than 10 from wearing the headscarf and was challenged by two children and their parents.
The text of the legislation attempted to avoid charges of discrimination by banning "ideologically or religiously influenced clothing which is associated with the covering of the head".
Nevertheless, the court said that the law could only be understood as targeting Islamic head coverings.
The law was introduced in May 2019 under a previous coalition of the centre-right People's Party and the far-right Freedom Party only days before it collapsed due to a corruption scandal.
Both parties had made warnings about "parallel societies", a central part of their political message, and their representatives made it clear at the time that the law was focused on the headscarf.
The court said that far from promoting integration, "the ban could... lead to discrimination as it runs the risk of making it more difficult for Muslim girls to gain access to education and it socially excludes them".
When the law was introduced, the Islamic community group IGGOe said that only a "minuscule number" of girls would be affected.
"We don't condone disparaging attitudes towards women who decide against the headscarf... and we also cannot agree with the curtailing of the religious freedom of those Muslim women who understand the headscarf to be an integral part of their lived religious practice," IGGOe President Umit Vural said in a statement on Friday.
The current government, a People's Party-Green Party coalition, had planned to extend the ban to include girls under 14.
Education Minister Heinz Fassmann said that the ministry would "take note of the judgment and look into its arguments".
"I regret that girls will not have the opportunity to make their way through the education system free from compulsion," he added.