Sheriff Kenneth Mitchell, in a written judgment, upheld a plea by the boy's father that the council was not entitled to exclude 14-year-old Stephen MacKay from Govan High by using a "purported transfer" to another school.
The school's transfer request followed Stephen's exclusions for five days on two separate occasions in December 2000 and May 2001 for disruptive behaviour and a 20-day exclusion in October 2001 after a classroom incident that led to another pupil breaking an arm.
Stephen was not permitted to return to the school and was transferred instead to the city's Hillpark Secondary in November 2001 "in order to give him a fresh start".
Stephen's father, Christopher Proudfoot, attempted to appeal against the decision to move him but was told by the council that a transfer did not fall within the legislation covering exclusions and would have to be addressed "as a separate issue".
Mr Proudfoot told The TESS he had no problem with the first two exclusions, but felt the third was too harsh. He also objected to the transfer order, partly because he believed it was unjustified and also because it involved considerable extra travel for his son.
Iain Nisbet, the lawyer representing the family at the hearing in Glasgow Sheriff Court, claimed that the council was "just using exclusion by another name", and that the policy of forcing pupils to travel to another school denied both parent and pupil their legal right to appeal against the authority's decision.
Sheriff Mitchell upheld this argument and rejected the council's claim that transfer and exclusion were "separate and distinct matters". The transfer, he said, amounted to an actual and "unlawful" exclusion.
"In my judgment, the duty to provide education for an excluded pupil entitles the authority to transfer that pupil to another school only for the duration of the exclusion," the sheriff said. Stephen should then have been readmitted to Govan High.
Mr Proudfoot said he was delighted his son would now be returning to Govan High at the start of the session, and added: "Stephen has not enjoyed missing so much schooling in the last eight months and is very happy at being able to go back to his local school."
The ruling could affect other councils, according to Mr Nisbet. "While the decision is not strictly legally binding," he said, "other sheriffs in Scotland are likely to follow it in similar cases."
A spokesperson for glasgow city council said it was considering the sheriff's judgment and would be reviewing its practices in the light of the case.
She added: "Our policies and practices are very much geared towards continuing education and, in the majority of cases, the transfer of pupils in similar circumstances has had a positive outcome."