An Islamic faith school's policy of segregating boys from girls has been ruled unlawful sex discrimination by leading judges.
Three Court of Appeal judges held that the mixed-sex Al-Hijrah school's policy of complete segregation from year five caused detriment and less favourable treatment for both male and female pupils by reason of their sex, and was contrary to the 2010 Equality Act.
For religious reasons the voluntary-aided school, which has pupils aged between four and 16, believes that separation of the sexes from year five onwards is obligatory.
The Birmingham school has complete segregation of boys and girls from nine to 16 for all lessons, breaks, school clubs and trips.
The verdict at the Court of Appeal in London overturned a High Court judge's finding last year that Ofsted inspectors has been wrong to penalise the school for the segregation policy.
In a test case ruling on Friday, the Master of the Rolls Sir Terence Etherton, Lady Justice Gloster, and Lord Justice Beatson unanimously allowed a challenge by Ofsted's chief inspector Amanda Spielman against Mr Justice Jay's decision.
The landmark decision will affect other schools which have a segregation policy.
The appeal judges said: "It is common ground that the school is not the only Islamic school which operates such a policy and that a number of Jewish schools with a particular Orthodox ethos and some Christian faith schools have similar practices."
Ms Spielman said after the ruling: "The school is teaching boys and girls entirely separately, making them walk down separate corridors, and keeping them apart at all times.
"This is discrimination and is wrong. It places these boys and girls at a disadvantage for life beyond the classroom and the workplace, and fails to prepare them for life in modern Britain."
The Equality and Human Rights Commission supported the decision.