Binge-eaters and drug addicts are both at the mercy of the same molecular effects in the brain, the research suggests.
The findings may explain why some people find it so hard to stop gorging on junk food.
Scientists found that obesity coincides with a progressive chemical imbalance in the brain's "reward" circuits.
These produce feelings of pleasure from activities such as eating and sex, and are known to play a role in addiction.
As the reward centres become less responsive, rats given
easy access to fatty food quickly develop compulsive over-
eating habits, the US research showed.
The animals consumed ever larger amounts of calories until they become obese.
Exactly the same changes in the brain were seen to occur when the rats were given cocaine or heroin.
Dr Paul Kenny, from the Scripps Research Institute in Jupiter, Florida, said: "In the study, the animals completely lost control over their eating behaviour, the primary hallmark of addiction. They continued to overeat even when they anticipated receiving electric shocks, highlighting just how motivated they were to consume the palatable food."
The rats were fed a diet based on those contributing to obesity in humans which included high-fat foods such as sausage, bacon and cheesecake. Their progress was compared with that of a group of "control" rats given a normal diet.
Soon after the experiment began, the rats on the junk food diet started to bulk-up dramatically.
"They always went for the worst types of food, and as a result, they took in twice the calories as the control rats," said Dr Kenny.
"When we removed the junk food and tried to put them on a nutritious diet – what we called the 'salad bar option' – they simply refused to eat."
The research, reported in the journal Nature Neuroscience, showed how the brain over-reacted to excess stimulation by tasty fatty food.