The European Court of Justice was asked to consider the case of a male childminder in Denmark who says he was sacked for being too fat.
The court said that if obesity could hinder “full and effective participation” at work then it could count as a disability.
The ruling is binding across the EU.
Judges said that obesity in itself was not a disability – but if a person had a long term impairment because of their obesity, then they would be protected by disability legislation.
The case centres around childminder Karsten Kaltoft who weighs about 160kg (25 stone).
He brought a discrimination case against his employers of 15 years, Billund local authority, after he was sacked four years ago.
The authority said a fall in the number of children meant Mr Kaltoft was no longer required.
But Mr Kaltoft said he was dismissed because he was overweight.