Even on those days when it feels particularly difficult to drag yourself to the gym, it's always worth it for that moment when you step out of class feeling calm, euphoric, and ready to tackle just about anything that comes your way. That's because, in a way, exercise really is a drug: It actually triggers responses in your brain that give way to a dramatic boost in mood and the release of stress. Oh, and did I mention it can actually make you smarter, too?

We might think of working out as a purely physical ritual, but the impact on our minds might be even more compelling. Below, learn about all the fascinating mental benefits of exercise.

Your stress disappears almost instantly.

Once your brain detects that your heart rate has been elevated for a sustained amount of time, it immediately goes into fight-or-flight mode—and one of its ingenious responses is to immediately adapt your body to the stress it's facing.

"When we exercise, our brains release endorphins and brain-derived neurotrophic factor, or BDNF," says Charles Passler, a leading (and celeb-favorite) nutritionist. BDNF is key to the growth, protection, and regeneration of our brains—which is why our minds tend to be sharper when we exercise consistently (more on that in a minute), he tells us.

That's not to mention that moving consistently helps keep your body's stress hormone levels in check, too. Just be sure not to overdo it, which can actually have the opposite effect. Passler also recommends mixing things up in order to maintain that initial stress response. "Our bodies are made to adapt and sustain through a life-threatening situation," he says. "If we keep our heart rate elevated consistently throughout the workout, we won't receive as many benefits as we would if we trained in intervals. Intervals allow our bodies to receive all the initial benefits of an increased heart rate without giving our brain time to tell our body how to adapt to the exercise."

One of the most quotable movie lines of our time happens to be very correct. "The endorphins released directly improve our mood," says Passler. "The combination of released BDNF and endorphins, through exercise, give us a mental clarity, mental stability, and happiness—sometimes to the point of euphoria."

That's another byproduct of BDNF, since part of its role is to help regenerate and improve the function of your neurons. "Studies on animals have also shown that exercise mobilizes gene expression profiles leading to enhanced brain plasticity," says David Harris, VP of health and human performance at Equinox. "This allows for higher-functioning gray matter."

Again, one of the byproducts of that surge of BDNF is a stronger neural response all around. Pair that with a boost in circulation, and you expect to feel improvements in your memory, focus, and cognitive ability. And these effects will only get better with time, says Harris—especially if you consistently challenge yourself.

"Increased blood flow and oxygen as well as challenging neurological situations—ranging from movement-based patterns that challenge coordination, balance and situational response that require speed processing—will all help improve cognitive function," he says. That's why you might feel hyper-focused immediately after exercising.

You might feel better equipped to deal with mental conditions like anxiety, depression, and ADHD.

Fellow insomniacs, take note: Consistent exercise is one of the best sleeping pills out there. One recent study of more than 2600 men and women found that those who engaged in 150 minutes of moderate to vigorous activity per week reported a 65% increase in sleep quality and less fatigue during the day. You can also rest even easier knowing that 150 minutes is really not that much, right?

This article is provided for informational purposes only and is not intended to be used in the place of advice of your physician or other medical professionals. You should always consult with your doctor or healthcare provider first with any health-related questions. See our full health disclaimer here.