Smoking marijuana when you’re young can dull your brain. But when you’re old, it may have the opposite effect.

That’s the conclusion of recent research studying the effects of cannabis on mice. Researchers from Bonn University in Germany and Hebrew University in Jerusalem treated aging mice with tetrahydrocannabinol, or THC—the psychoactive component in marijuana—and found that it reversed the brain’s aging process. Not only did mature and elderly mice perform better on cognitive tests after treatment, but their brain tissue and genetic markers showed physical changes indicative of cognitive youth, according to the study published in Nature Medicine on May 8.

Conversely, young mice treated with THC did worse on cognitive tests after treatment, a finding that’s consistent with marijuana studies on human youth.

The results confirmed the researchers’ hypothesis that cognitive aging is associated with a decline in the ability of receptors in the brain and body’s endocannabidiol system to receive chemical signals. This system helps mammals, including people, regulate things like appetite, mood, and memory as well as the response to marijuana. THC appears to stimulate these receptors in older mice.

To test the impact of treatment with THC, scientists chose mice because they have condensed lives compared to humans. Mice are considered young at two months, mature at 12 months, and elderly at 18 months. The research team administered low doses of THC and compared the three age groups—two-month-olds as compared to 12- and 18-month-olds.

They conducted three different kinds of tests in order to measure the effects of THC treatment. First, mouse memory was tested with a maze-navigating exercise which involves learning and recollection. A control group of older mice was unsuccessful at this test, and young mice treated with THC also performed poorly. But the mature and elderly mice treated with THC did well on the test, as well as two-month-old untreated mice.

Second, the research team studied novelty object location, whether mice were able to locate a Lego piece that was moved. “In the object location recognition test we used three identical Lego figures,” researcher Andras Bilkei-Gorzo of the Institute of Molecular Psychology at Bonn University said in an interview. “We changed the position of one figure in the second trial. [Mice] that remembered the original positions spent more time investigating the object in the new position.”

Young mice who weren’t treated with THC were able to locate repositioned objects easily, as were mature and elderly treated mice. But a control group of older animals not treated with THC couldn’t locate moved objects with the same ease. ”Preference for the object in a new position (novelty preference) is an indicator that animals have recognized the repositioning of the object,” the researchers explain.

Third, the mice performed a partner recognition exercise. Older rodents treated with THC performed much better than older control groups. To test partner recognition, individual mice were initially placed in an open area that contained a cage with another unknown mouse. An aluminum can that was a similar size, shape, and material as the cage was also placed in that open area but it contained no other mouse.

After 24 hours, the mouse was again placed in the open area and presented with two cages, one that contained the prior day’s partner and one containing a new, unknown mouse. The researchers determined that the mice recognized the prior day’s partner mouse if they spent more time with the new partner. They found that the THC-treated mature and older mice were inclined to be more interested in the new partner.

Finally, the researchers analyzed the brain tissue and genetic markers of the treated mice. They found that the aged mice no longer showed the typical genetic markers of their age. Most notably, increased connectivity in their brain circuitry indicated that the THC treatment had literally reversed the aging process and restored the cognitive power of youth, making it easy for older mice to learn new things.

The next step in research is clinical trials on humans. “Although there is a long path from mice to humans, I feel extremely positive about the prospect that THC could be used to treat dementia, for instance,” North Rhine-Westphalia science minister Svenja Schulz said in a statement.

If THC works to restore cognitive youth in people, there may someday be many more old stoners living among us.