The European Court of Justice had been asked by a Danish court to consider the case of a child minder in Denmark who said he was fired four years ago because he is obese.
The employee, Karsten Kaltoft, filed a suit to obtain damages and interest from the municipality of Billund which employed him in the job, claiming he was the victim of discrimination.
The Danish court asked the Luxembourg court whether EU law itself prohibits discrimination on grounds of obesity and whether obesity can be considered a disability.
The EU court ruled on Thursday that "no general principle of EU law prohibits, in itself, the discrimination on grounds of obesity".
But it said the "condition falls within the concept of 'disability' where... it hinders the full and effective participation of the person concerned in professional life on an equal basis with other workers".
The EU court said however it was up to the Danish court to "determine whether Kaltoft's obesity falls within the definition of disability".
'A great victory'
Danish trade union FOA, which was acting on behalf of Kaltoft, described the ruling as "a great victory".
The town of Billund "has said all along that Karsten Kaltoft's obesity could never constitute a disability because it was self-inflicted. The European Court of Justice flatly rejects this argument," the union said in a statement.
Lawyer Jacob Sand, who represented Kaltoft, said the court's decision protected a "vulnerable group of workers" but admitted that obesity could still be grounds for dismissal in cases where the employee is unable to perform the job they were hired to do.
"A person who is dismissed if they are not competent, capable and available for the position has not been subjected to discrimination because it is only reasonable and factual to dismiss such a person," he told AFP.
It was only discrimination if "the person can perform his job but may be in need of some help to do it," he said.
However, Britain's National Obesity Forum said it "opened a can of worms for all employers" by pushing them to adapt to the problem of obesity rather than responding to it as a condition requiring remedial measures.
"They will be required to make adjustments to their furniture and doors and whatever is needed for very large people," said spokesman Tam Fry, who believed member states would challenge the ruling.
"I believe it will also cause friction in the workplace between obese people and other workers," he added.
Matthew Elliott, chief executive of campaign group Business for Britain blasted the ruling as "yet another example of a decision by an EU court with no thought for the consequences or impact on business and the wider economy".
Others said the impact on existing legislation would be limited.
"Obesity in itself has not previously been classed as a disability in British law," said Claire Dawson, employment lawyer at Slater and Gordon in London.
"However, where an obese person has other health difficulties that can be associated with and potentially compounded by obesity, such as mobility difficulties, diabetes or depression, these may give rise to protection against disability discrimination," she said.