The family of a boy suspended from a Gloucester school for refusing to cut his hair took legal action to force his re-instatement.
Sam Grant, aged 16, was suspended from Sir Thomas Rich School after refusing to cut his hair short.
The teenager, who has mixed-race parents, said he grew his hair to prevent racist remarks from pupils.
He was allowed back after his parents challenged the school saying the ban had affected their son's schoolwork.
Sam said: "It's easier and friendlier for people to comment on my hair and call me 'mophead' or something like that rather than derogatory names."
"I'm mixed-race and I found that having longer hair ended remarks of a racist nature."
Sam's father, solicitor Stephen Grant, said the school had discriminated against him on grounds of sex and race and that the rule was old-fashioned.
"The reaction of the school was ridiculous and we were totally shocked at its inflexibility and failure to engage in meaningful debate about the underlying issues."
He added: "I understand they have school rules but to suspend him from coming back to school unless he cut his hair was draconian.
"Pupils committing acts of theft and damage received less severe disciplinary sanctions."
The incident started in March 2005, when Sam and a number of other boys were told to get their hair cut.
When he refused he was suspended at the end of June for 10 days.
His father applied for an injunction blocking the suspension but as part of the proceedings both parties agreed to mediation which resulted in Sam being allowed to finish his GCSEs.
A spokeswoman for Sir Thomas Rich School said she could not comment under the terms of an agreement reached on the case with the family.
Sam has since left the school, and plans to study for his A-levels at another location.