The 55 mice used in the University of Florida study had been bred to develop symptoms of Alzheimer's disease.
First the researchers used behavioural tests to confirm the mice were exhibiting signs of memory impairment when they were aged 18 to 19 months, the equivalent to humans being about 70.
Then they gave half the mice caffeine in their drinking water. The rest were given plain water.
The mice were given the equivalent of five 8 oz (227 grams) cups of coffee a day - about 500 milligrams of caffeine.
The researchers say this is the same as is found in two cups of "specialty" coffees such as lattes or cappuccinos from coffee shops, 14 cups of tea, or 20 soft drinks.
When the mice were tested again after two months, those who were given the caffeine performed much better on tests measuring their memory and thinking skills and performed as well as mice of the same age without dementia.Those drinking plain water continued to do poorly on the tests. In addition, the brains of the mice given caffeine showed nearly a 50% reduction in levels of the beta amyloid protein, which forms destructive clumps in the brains of dementia patients.
Further tests suggested caffeine affects the production of both the enzymes needed to produce beta amyloid. The researchers also suggest that caffeine suppresses inflammatory changes in the brain that lead to an overabundance of the protein.