Britain's Court of Appeal on Wednesday overturned a previous court ruling in favour of Shabina Begum's claim that her school wrongly refused to allow her to wear the hijab.
The hijab, which includes what is referred to as a Jilbab, covers the entire body including the hair except for the hands and face, fulfils the requirements of Islamic dress code for women.
"What went wrong in this case was that the school failed to appreciate that by its action it was infringing on the claimant's Article 9 right to manifest her religion," Judge Scott Baker said, referring to religious freedom legislation.
Shabina started at Denbigh High School in Luton, north of London, in September 2000, and at first wore a shalwar kameez - consisting of trousers and a tunic - which school rules allowed.
The Muslim Council of Britain has
welcomed the court's ruling
But as her interest in Islam deepened, she returned after the summer break in September 2002 wearing the hijab, and was ordered to go home and change.
Britain's main Islamic umbrella group, the Muslim Council of Britain (MCB), welcomed Wednesday's ruling.
MCB head Iqbal Sacranie said in a statement: "This is a very important ruling on the issue of personal freedoms. Many other schools have willingly accommodated Muslim schoolgirls wearing the jilbab."
"Those that believe and choose to wear the jilbab and consider it to be part of their faith's requirement for modest attire should be respected. Today's judgment is a clear reflection of that common sense view."
The British case mirrors one in France, where a ban on Muslim headscarves, Jewish skullcaps and large Christian crosses being worn in schools sparked a bitter row.