Multiple sclerosis is caused by damage to the nerves
Mice given the equivalent of six to eight cups of coffee a day were less likely to develop a disease similar to multiple sclerosis, a study found.
Researchers hope this could lead to new ways to prevent MS in humans.
The Proceedings of the National Academy of Sciences journal reported that the caffeine appeared to prevent nervous system damage.
However, experts recommend no more than five cups a day, amid evidence higher doses can worsen diabetes.
While the chain reaction which leads to multiple sclerosis is still not fully understood, a key moment surrounds the entry of immune cells into the central nervous system.
Once there, they trigger "autoimmune" attacks, gradually and progressively destroying the fatty myelin sheaths that protect nerves.
Current treatments for MS are limited only to slowing the progress of the disease once it is established.
At Cornell University in the US, and Turku University in Finland, the researchers are using a mouse disease called "experimental autoimmune encephalomyelitis", or EAE, to mimic the development of MS in humans.
One of the effects of caffeine in both mice and humans affects a molecule called adenosine, which plays a role in sleep and energy production.
When mice were dosed with caffeine, adenosine could not link to a particular receptor on the surface of cells.
This in turn appeared to have an indirect effect on the ability of immune cells to enter the nervous system at a part of the brain called the choroid plexus, and the mice did not develop EAE.
While the precise reason this happened was not clear, the researchers suggested the adenosine blocking effect led to a lower number of "adhesion molecules" - needed by the immune cells to gain entry - on the surface of the choroid plexus.
Risks and benefits
Dr Linda Thompson, who led the study, said that the next step was to see if humans who drank plenty of coffee showed any signs of being less prone to MS.
"If you found a correlation between caffeine intake and reduced MS symptoms, that would point to further studies in humans."
However, even if this were established, coffee might not be a good way to prevent MS.
The six to eight cups given to the mice is above the limit set by the Department of Health.
Other research has suggested that it might be physically addictive at these levels, and might worsen the control of type II diabetes, a far more common disease of older people.
A spokesman for the MS Society was also cautious: "Over the years there have been numerous discoveries that have prevented EAE in mice but turning this into effective therapies for humans remains a challenge.
"Based on the results of this study, we wouldn't advise people to change their caffeine intake."