New research has found caffeine can help manage stress and potentially prevent conditions like depression and memory loss.

An international team of scientists from Portugal, the United States and Brazil studied how caffeine could reduce the impact of stress on the brain.

Rodrigo Cunha from Portugal's University of Coimbra said his team fed mice caffeine in their drinking water, then put some of the animals under stress.

He said the caffeine had a calming effect on the mice.

"If the animal is not stressed there isn't a very evident change in physiological parameters or behaviour," he said.

"However, if you introduce changes to the lifestyle of the animals, what we see is they cope much better."

Associate Professor Cunha and his team found caffeine blocked a stress-related chemical and prevented associated issues such as memory loss.

"What caffeine is doing is not making the system work better; what caffeine is doing is avoiding the system going into the wrong way of working," he said.

"So it's a prevention of a deterioration, rather than an improvement."

Associate Professor Cunha said previous studies had found caffeine could help to reduce depression, but it was not clear whether it was the act of buying caffeine or the caffeine itself which cheered people up.

"This study was the first to establish a causal link," he said.

"It is indeed caffeine. Because mice didn't go to the coffee shop, mice didn't spend more time with each other.

"All those factors were controlled. The only variable was the intake of caffeine."

However, Associate Professor Cunha said humans had very different brains to mice and that further investigation was needed.

He said the latest study was a step towards better treatments for stress and associated illnesses, because more potent and selective caffeine molecules could eventually lead to drugs that could interrupt mood dysfunction.