14-year-old Sarika Watkins Singh was excluded from Aberdare Girls' School in South Wales in November 2007, for refusing to remove a wrist bangle which is central to her faith.
Justice Silber in the High Court today said the bangle - known as the kara - was a symbol of her Sikh faith and not a piece of jewellery. "The school is guilty of indirect discrimination under race relations and equality laws."
As a sequel to the judgment, Sarika will be returning to the school in September wearing the Kara, a slim steel bracelet.
Sarika said: "I am overwhelmed by the outcome and it's marvelous to know that the long journey I've been on has finally come to an end. I am so happy to know that no-one else will go through what me and my family have gone through.
"I just want to say that I am a proud Welsh and Punjabi Sikh girl."
Her mother, 38-year-old Sinita said: "We are over the moon. It is just such a relief."
Her lawyers had told Justice Silber that the Kara was as important to her as it was to England spin bowler Monty Panesar, who has been pictured wearing the bangle.
Sarika, of mixed Welsh and Punjabi origin, of Cwmbach, near Aberdare, who was the only Sikh among 600-strong girls, was at first taught in isolation and eventually excluded for refusing to take off the bangle in defiance of the school's policy, which prohibits the wearing of any jewelery other than wrist watch and plain ear studs.
In February, Sarika enrolled in another school, Mountain Ash Comprehensive, which allowed her to wear the kara, but her parents said the move had disrupted her schooling.
Her parents went to Downing Street last month to hand over a petition to Prime Minister Gordon Brown seeking his intervention in the matter to show "discrimination is totally unacceptable".
The petition was supported by 150 Gurdwaras, more than 200 Sikh organisations and 70 non-Sikh organisations. More than 100 MPs from different parties also supported the petition.
Anna Fairclough, Liberty's legal officer who represented Sarika said: "This common sense judgment makes clear you must have a very good reason before interfering with someone's religious freedom.
"Our great British traditions of religious tolerance and race equality have been rightly upheld today."