A secondary school acted appropriately in banning a Muslim teenager from wearing religious dress, the Law Lords said this week.
They overturned an earlier appeal court ruling that Shabina Begum's human rights were violated when she was sent home from Denbigh high, in Luton, for wearing a full-length jilbab.
The judgement was welcomed by teacher unions who said common sense had prevailed and authority had been restored to schools.
John Dunford, general secretary of the Association of School and College Leaders, said: "I am delighted. Uniforms are there to subjugate individual preference and create a community ethos in schools."
Mick Brookes, general secretary of the National Association of Head Teachers, said the ruling "shows that where a school is sensitive to local issues and has a good consultative process, its judgement will be upheld in law".
Lord Bingham said the Bedfordshire school had been fully justified in its actions. "It had taken immense pains to devise a uniform policy which respected Muslim beliefs but did so in an inclusive, unthreatening and uncompetitive way," he said.
"The rules laid down were as far from being mindless as uniform rules could ever be. The school had enjoyed a period of harmony and success to which the uniform policy was thought to contribute."
The school refused to comment but in a statement issued on its behalf said:
"We are pleased the House of Lords has upheld the school's right to set its own uniform policy and to enforce it while staying within the law."
It said that the Law Lords "acknowledged that the school did not deny Shabina Begum the right to manifest her religion or indeed unlawfully exclude her from school".
Shabina, who is now 17 and no longer attends Denbigh, took the school's head and governors to court for denying her the "right to education and to manifest her religious beliefs" under the Human Rights Act and the European Convention on Human Rights.
She said after this week's ruling: "Obviously I am saddened and disappointed about this, but I am quite glad it is all over and I can move on.
"Even though I lost, I have made a stand. Many women out there will not speak up about what they actually want."
She said she would consult with her lawyers on whether to take the case to the European Court of Human Rights.
The cost of the case so far is about pound;50,000 in legal aid.
* September, 2002: Shabina Begum is sent home from Denbigh high, Luton, for wearing a jilbab.
* February 13, 2004: Papers are lodged at Royal Courts of Justice, in London, asking for a judicial review.
* February 23, 2004: A judge rules she has a case for judicial review.
* May 27, 2004: The High Court is told the ban denies Shabina's education and her right to practise her religion.
* June 15, 2004: The High Court rules against Shabina. Mr Justice Bennett says her human rights not infringed.
* December 20, 2004: The ruling is challenged at the Court of Appeal, where Cherie Booth QC, representing Shabina, tells judges the school acted unlawfully in barring her.
* March 2, 2005: The Court of Appeal reverses previous decision.
* February 6, 2006: Denbigh high takes the case to the House of Lords, where five Law Lords are asked to review the human rights implications.
* March 22, 2006: House of Lords rules in favour of the school.