(NEXSTAR) – It may not surprise you that coffee drinking can improve alertness, but a new study found that caffeine and the popular beverage may have other positive effects when it comes to the brain’s functions.

Researchers from the University of Minho School of Medicine in Portugal conducted the study, which was sponsored by the Institute for Scientific Information on Coffee (ISIC) and published in “Molecular Psychiatry.”

The research team, led by School of Medicine President Nuno Sousa, used functional magnetic resonance (fMRI) technology to compare brain activity of coffee drinkers to non-coffee drinkers while they were resting, performing a task and just after drinking a cup of coffee.

“This is the first time that the effect that drinking coffee regularly has on our brain network is studied with this level of detail,” Sousa wrote. “We were able to observe the effect of coffee on the structure and functional connectivity of our brain, as well as the differences between those who drink coffee regularly and those who don’t drink coffee, in real time.”

Researchers said they found a link between drinking coffee and a decreased degree of connectivity in the right precuneus and right insular areas of the brain, which suggests improved motor control and higher levels of alertness.

Brain activity documented in the fMRI imaging also showed dynamic activity in several areas that are associated with an increased ability to focus, learn and remember.

According to the study, when non-coffee drinkers had a cup, they also demonstrated similar brain activity shortly after consuming coffee.

On a less positive note for coffee fans, researchers found higher levels of stress among those who drink it regularly.

“These conclusions can, at least to some extent, help to offer a mechanistic view for some of the observed effects,” Sousa stated.