Morning erections are triggered by cycles of REM (rapid eye movement) sleep, not by sexual dreams, a full bladder, or any conscious arousal. During REM, the brain shifts its chemical signaling in a way that relaxes smooth muscle tissue in the penis and increases blood flow, producing an erection that can last anywhere from a few minutes to half an hour. Because the longest REM periods cluster toward the end of the night, men often happen to wake up during or just after one of these episodes. The phenomenon is so consistent in healthy males that clinicians have used it for decades to help distinguish physical causes of erectile problems from psychological ones.
What Happens in the Brain During REM Sleep
When you transition from lighter sleep stages into REM, your autonomic nervous system undergoes a pronounced shift. Activity in the cholinergic system ramps up while noradrenergic signaling, which normally keeps the penis in its flaccid resting state, drops off. That combination is the key trigger. The increased cholinergic activity promotes the release of nitric oxide, a molecule that dilates blood vessels and relaxes smooth muscle in the erectile tissue. Blood flows in, the tissue expands, and an erection forms without any conscious input.1International Journal of Impotence Research. The role of sleep stages in the regulation of erectile function: impacts of REM sleep fragmentation
REM sleep is not evenly distributed through the night. Early in the night, REM episodes are short, sometimes only a few minutes. As the hours pass, they grow longer and more frequent. This matches what researchers see when they monitor erections in a sleep lab: the later episodes tend to be firmer and last longer than the ones earlier in the night. If you sleep a full seven or eight hours, your final REM cycle may run 30 to 45 minutes, which is why you are most likely to notice an erection when the alarm goes off.
These sleep-related erections occur in all healthy males regardless of age, from newborns through elderly men, though their frequency and firmness do change over time.2PubMed. Sleep-related erections: neural mechanisms and clinical significance They are not a quirk of young adulthood or a byproduct of high libido. They are a basic feature of normal male sleep physiology.
Why the Body Bothers Doing This
One long-standing question is what purpose these erections actually serve. You are asleep, so they are not directly useful for reproduction. The leading hypothesis is tissue maintenance. Penile erectile tissue needs oxygen to stay healthy, and during the many hours it spends in its flaccid state, blood flow is relatively low. Periodic engorgement during sleep floods the tissue with oxygenated blood, which researchers believe helps prevent a type of scarring called cavernous fibrosis.3PubMed. Testosterone and sleep-related erections: an overview
Cavernous fibrosis matters because it is the structural basis for one of the most common forms of organic erectile dysfunction. When fibrous tissue replaces the normal smooth muscle in the penis, the tissue loses its ability to trap blood efficiently, leading to erections that are weak or cannot be sustained. In this framework, nighttime erections work something like stretching a muscle you are not actively using: they keep the tissue flexible, oxygenated, and functional. This idea also lines up with research on penile rehabilitation after prostate surgery, where medications that promote blood flow to the erectile tissue are used specifically to prevent fibrosis and preserve smooth muscle content during the recovery period.4PubMed Central. Tadalafil therapy for erectile dysfunction following prostatectomy
Despite decades of study, researchers acknowledge that the mechanisms behind sleep-related erections and their full biological function are still not completely understood.5PubMed. Sleep-related erections throughout the ages The tissue-oxygenation theory is plausible and well-supported by indirect evidence, but it has not been proven in the way that, say, the role of insulin in blood sugar regulation has been proven. It remains the best explanation available.
The Role of Testosterone
Testosterone is not the immediate trigger for morning erections, but it sets the stage. Research has found a clear relationship between both total and free testosterone levels and the occurrence of nocturnal erections.6PubMed. Nocturnal penile tumescence and serum testosterone levels Men with higher free testosterone tend to have more frequent nighttime erections, longer episodes, and greater increases in penile circumference during those episodes.
A study examining healthy males across a wide age range, from childhood through old age, found that free testosterone levels correlated with multiple measures of nighttime erectile activity, including total tumescence time, how long each episode lasted, and how much the penis expanded during each event.7PubMed. Study on nocturnal penile tumescence (NPT) in healthy males This makes intuitive sense: testosterone supports the responsiveness of the smooth muscle and vascular systems involved in erections. When testosterone drops, the downstream machinery works less efficiently.
Testosterone levels themselves follow a daily rhythm. They tend to peak in the early morning hours and decline through the afternoon and evening, which means the hormonal environment at the end of a night’s sleep is primed to support erectile activity. This hormonal peak does not cause the erection on its own, but it creates the most favorable conditions for one to happen during that final REM cycle.
What Morning Erections Tell You About Your Health
For decades, clinicians have used the presence or absence of nighttime erections as a diagnostic clue. The logic is straightforward: if the neurological and vascular hardware needed for an erection works fine during sleep, then erectile problems during waking hours are more likely psychological in origin. If the erections are absent or weak during sleep as well, the problem is more likely to involve something physical, whether vascular disease, nerve damage, or a hormonal deficiency.
In practice, this has been formalized through nocturnal penile tumescence and rigidity (NPTR) monitoring. A normal recording in a man who reports erectile difficulties suggests the cause is likely psychological, while an abnormal recording points toward an organic problem.8Sexual Medicine Reviews. The Role of Nocturnal Penile Tumescence and Rigidity (NPTR) Monitoring in the Diagnosis of Psychogenic Erectile Dysfunction: A Review In one classic sleep-lab study, 56 men referred for erectile problems were monitored over three nights. Based on their nocturnal erection patterns, 48 were classified as having an organic cause and eight as having a psychological one.9PubMed. Psychometric differentiation of psychogenic and organic erectile disorders
The technology for this monitoring has evolved considerably. At least seven distinct methods and their variations have been developed, ranging from simple stamp tests and snap gauges to sophisticated electronic devices like the RigiScan, which tracks both circumference changes and rigidity at the base and tip of the penis throughout the night.10International Journal of Impotence Research. Advantages and limitations of sleep-related erection and rigidity monitoring: a review RigiScan data has even been used to predict whether men with erectile dysfunction will respond to medications: those with rigidity readings below a certain threshold tend not to respond well to drugs like sildenafil.11PubMed Central. Nocturnal penile erections: A retrospective study of the role of RigiScan in predicting the response to sildenafil in erectile dysfunction patients
So if you regularly wake up with an erection, it is a quiet but meaningful signal that the blood vessels, nerves, and hormonal pathways involved in erectile function are in reasonable working order. It does not guarantee everything is perfect, but it is a reassuring sign. Conversely, if you notice a gradual or sudden disappearance of morning erections, that could be worth mentioning to a doctor, especially if it coincides with other changes in your health.
How Aging Affects Morning Erections
Morning erections do not disappear with age, but they do become less frequent and less firm. A cross-sectional study of 220 men aged 41 to 93 found that aging and hormonal changes were more strongly related to sexual activity and nocturnal erections than to libido itself. In other words, older men may still feel desire, but their bodies produce fewer and weaker nighttime erections.12Oxford Academic (The Journal of Clinical Endocrinology & Metabolism). Hormonal Changes and Sexual Function in Aging Men
Part of this is hormonal. Testosterone declines gradually with age, and as described earlier, testosterone supports the vascular and smooth-muscle systems that produce erections during sleep. But hormones are only one piece. Older men are also more likely to have conditions that affect blood vessels and nerves, such as diabetes, high blood pressure, and cardiovascular disease. They are more likely to take medications that interfere with erectile function. And the architecture of sleep itself changes: older adults spend less total time in REM sleep and are more prone to sleep fragmentation, both of which reduce opportunities for nighttime erections.
None of this means that a 70-year-old who does not wake up with an erection should be alarmed. The decline is gradual and expected. But a younger man who rarely or never notices morning erections might want to consider whether something else is going on, especially if he is also having trouble with erections during waking hours.
Sleep Disorders That Interfere With Erections
Because morning erections depend on healthy REM sleep, anything that disrupts sleep architecture can reduce or eliminate them. Obstructive sleep apnea is the most studied culprit. When the airway collapses repeatedly during sleep, it causes drops in blood oxygen that trigger a cascade of vascular and inflammatory events. Circulating nitric oxide levels fall, the lining of blood vessels becomes damaged, and the same molecule that is supposed to relax smooth muscle in the penis during REM is less available.13PubMed Central. Erectile Dysfunction and Obstructive Sleep Apnea: A Review
Research has found that severe sleep apnea is significantly associated with decreased erectile function, though milder forms may not produce a measurable effect.14PubMed. Severe, but not mild, obstructive sleep apnea syndrome is associated with erectile dysfunction In one study focused on the link between sleepiness severity and erectile dysfunction, about 80% of men with abnormal daytime sleepiness scores also had erectile dysfunction, compared with 20% of men whose sleepiness scores were normal. The correlation between how sleepy the men were and how severe their erectile problems were was strong.15PubMed. Defining association between sleep apnea syndrome and erectile dysfunction
Short sleep duration is another factor. Chronic sleep restriction elevates cortisol, the body’s primary stress hormone. Elevated cortisol promotes constriction of vascular smooth muscle, working directly against the vasodilation needed for erections. It has been reported that men with higher cortisol levels score worse on standardized erectile function questionnaires, and this relationship may reflect not just psychological stress but a disrupted hormonal axis driven by insufficient sleep.16PubMed Central. Short Sleep Duration and Erectile Dysfunction: A Review of the Literature
The practical implication here is that if morning erections have faded and you are also sleeping poorly, treating the sleep problem might help restore them. Men treated with CPAP therapy for sleep apnea often report improvements in erectile function, though results vary. And simply getting more sleep, when you are chronically cutting it short, can make a difference.
Shift Work and Disrupted Sleep Schedules
Working night shifts does not just leave you tired. It actively disrupts the circadian rhythms that organize your sleep stages, including REM. Research on shift workers found that regular night shifts were associated with substantially worse erectile function scores, with daytime sleeping also independently linked to decreased erectile function regardless of whether the men met criteria for a formal sleep disorder.17PubMed Central. Shift Work Sleep Disorder and Night Shift Work Significantly Impair Erectile Function
This is worth knowing because it highlights how much erectile health depends on good sleep and on sleeping at the right biological time. A man who sleeps six hours during the day after a night shift is not getting the same quality or structure of REM as someone who sleeps those same six hours at night. The body’s REM drive is regulated in part by the circadian clock, which expects you to be asleep in the dark hours. Sleeping against the clock compresses and fragments REM, reducing opportunities for the erections that serve tissue maintenance.
When Morning Erections Are Painful
For a small number of men, nocturnal erections are not a neutral background event but a source of real discomfort. Sleep-related painful erections, or SRPE, is a recognized condition in which erections during REM sleep cause enough pain to wake the person repeatedly. The erections themselves are otherwise normal in mechanics. Erections during waking hours, during intercourse, and during non-REM sleep stages are painless. The pain is specific to REM-related episodes.18PubMed Central. Narrative review: pathogenesis, diagnosis, and treatment of sleep-related painful erection
SRPE is poorly understood and relatively rare, which means the evidence base for treatments is thin. A meta-analysis of the available literature found that baclofen, a muscle relaxant, and to a lesser extent clonazepam showed the most noticeable results, likely by suppressing certain excitatory neurotransmitters and relaxing the muscles involved in erection.19The Journal of Sexual Medicine. Sleep-Related Painful Erections: A Meta-Analysis on the Pathophysiology and Risks and Benefits of Medical Treatments Treatment courses tend to run one to three months, and long-term follow-up data are scarce. If you experience repeated painful erections that wake you from sleep, it is worth bringing up with a urologist rather than assuming it is something everyone deals with.
Common Misconceptions
Several myths surround morning erections that are worth clearing up. The most persistent is that a morning erection means you were having a sexual dream. While sexual dreams can occur during REM, the erection is not caused by the dream’s content. It is caused by the neurochemical environment of REM sleep itself. Men in sleep labs who are awakened during erection episodes often report no dream at all, or a nonsexual one.
Another common belief is that a full bladder causes morning erections. The idea has a certain logic: a full bladder stimulates nearby nerves, which might produce a reflex erection. But this does not hold up. Nighttime erections occur throughout the sleep period, not just when the bladder is full, and they correlate tightly with REM cycles rather than bladder volume. The sensation of a full bladder may make you more aware of an erection that was already there, but it is not the cause.
A third misconception is that the absence of morning erections in a young man automatically means something is seriously wrong. While it can be a signal worth investigating, there are mundane explanations too. If you wake up during a non-REM period, you simply missed the window. Alarm timing, alcohol consumption the night before, poor sleep quality, or stress can all reduce the likelihood that you catch yourself during or right after a REM erection. A single morning without one is meaningless. A sustained pattern over weeks or months, combined with other changes in sexual function, is what warrants attention.
Erections Across the Animal Kingdom
Sleep-related erections are not unique to humans. They have been documented in other mammalian species, and penile erection during sleep has been observed in rats and other lab animals studied in the context of sleep physiology. In non-human mammals, erection in a sexual context has historically been taken as one of the few definitive behavioral indicators of sexual arousal.20PubMed Central. Sexual arousal, is it for mammals only? The presence of sleep-related erections across species suggests this is an evolutionarily old phenomenon, not a recent adaptation specific to humans. Whatever function it serves, whether tissue maintenance or something else entirely, it has been conserved over a long span of mammalian evolution, which implies it provides a genuine biological advantage.