A cup of coffee every morning not only boosts alertness, it may also help memory too, according to a new study HealthDay reported.

Researchers from John Hopkins University found that the popular stimulant could also enhance certain memories for up to 24 hours after it is consumed.

"We've always known that caffeine has cognitive-enhancing effects, but its particular effects on strengthening memories and making them resistant to forgetting has never been examined in detail in humans," Michael Yassa, senior author of the paper and assistant professor of neurobiology at the university, said in a statement. "We report for the first time a specific effect of caffeine on reducing forgetting over 24 hours."

For the study, researchers conducted a double-blind trial in which 100 participants who were “caffeine naïve” or did not regularly eat or drink caffeinated products received either a placebo or a 200-milligram caffeine tablet five minutes after studying a series of images, according to a press release.

Both groups were tested the next day on their ability to recognize images from the previous day's study session. On the test, some of the visuals were the same as those from the day before, some were new additions, and some were similar but not the same. Salivary samples were taken from the participants before they took the tablets to measure their caffeine levels. Samples were taken again one, three, and 24 hours afterwards.

Researchers found that people in the caffeine group were better at distinguishing the similar pictures from the original pictures, HealthDay reported. The participants in the placebo group erroneously cited the similar pictures as the same. This reflects a “deeper level” of memory retention.

"If we used a standard recognition memory task without these tricky similar items, we would have found no effect of caffeine," Yassa said. "However, using these items requires the brain to make a more difficult discrimination—what we call pattern separation, which seems to be the process that is enhanced by caffeine in our case."

Yassa added that the next step for his research team is to find out figure out the brain mechanisms underlying this enhancement.

"We can use brain-imaging techniques to address these questions. We also know that caffeine is associated with healthy longevity and may have some protective effects from cognitive decline like Alzheimer's disease. These are certainly important questions for the future," he said.

The study was published in the journal Nature Neuroscience.