An erection happens when blood fills two sponge-like chambers inside the penis and gets trapped there under pressure. The process involves a precise chain of events: your brain detects something arousing, sends signals down the spinal cord, and triggers a chemical release that relaxes blood vessels in the penis so they can open wide. The whole sequence, from arousal to full rigidity, typically takes seconds to a few minutes.
How Blood Flow Creates Rigidity
The penis contains two cylindrical chambers called the corpora cavernosa that run along its length. These chambers are made of spongy tissue packed with tiny blood vessels, all wrapped in a tough, fibrous outer shell. During arousal, the smooth muscle lining these chambers relaxes, allowing arteries to dilate and flood the tissue with blood.
What turns increased blood flow into actual firmness is a trapping mechanism. As the spongy chambers expand with blood, they compress the small veins that would normally drain blood back out of the penis. This compression pins those veins against the outer shell, essentially locking blood inside. The result is hydraulic pressure that produces rigidity. An erection isn’t just about blood flowing in; it’s about blood being unable to flow back out.
The Chemical Signal That Starts It All
The key molecule behind an erection is nitric oxide. When arousal signals reach the penis, nerve endings and the inner lining of blood vessels release nitric oxide directly into the spongy tissue. This triggers a chain reaction: nitric oxide activates an enzyme that produces a second messenger molecule (called cGMP), which tells the smooth muscle cells in the blood vessel walls to relax. Relaxed muscle means wider arteries and more blood flow.
This is also why erections don’t last forever. A separate enzyme continuously breaks down cGMP, which is the same molecule keeping the blood vessels open. Once arousal signals fade and nitric oxide production drops, that breakdown enzyme gains the upper hand, smooth muscle contracts again, the veins reopen, blood drains out, and the penis returns to its soft state. Common erectile dysfunction medications work by blocking this breakdown enzyme, giving cGMP more time to do its job.
Three Types of Erections
Not all erections start the same way. Your body actually has three distinct pathways for producing them, each triggered by different inputs.
Psychogenic erections start in the brain. Visual stimulation, fantasies, sounds, or even a memory can generate arousal signals that travel down the spinal cord to the nerves controlling penile blood flow. This is the type most people think of first.
Reflexive erections bypass the brain entirely. Direct physical touch to the genitals sends sensory signals to the lower spinal cord, which can trigger an erection through a local reflex loop. This is why erections can occur even during sleep or in people with certain spinal cord injuries that disconnect the brain from the lower body.
Nocturnal erections happen during REM sleep, typically three to five times per night. These are particularly sensitive to hormone levels. Men with healthy testosterone levels reliably experience them, and their presence (or absence) is sometimes used clinically to distinguish between physical and psychological causes of erectile difficulty.
What the Brain Does Behind the Scenes
Before any blood flow changes happen, the brain has to process arousal and send the right signals. Two neurotransmitters play central, opposing roles in this process.
Dopamine is the accelerator. It facilitates sexual motivation, promotes genital reflexes, and helps initiate erections. A key brain region involved in sexual function relies on dopamine to translate arousal into a physical response. Testosterone supports this process by boosting nitric oxide production in the brain, which in turn increases dopamine release. This is one reason low testosterone can dampen erectile function: it weakens the dopamine signal at its source.
Serotonin, broadly speaking, acts as the brake. It tends to inhibit sexual arousal and erection, which is why antidepressants that increase serotonin levels (SSRIs) commonly cause sexual side effects. The relationship is more nuanced than a simple on/off switch, though. Certain serotonin receptors can actually promote erections while suppressing ejaculation, and others do the opposite. But the general pattern holds: high serotonin activity tends to work against erectile function.
The balance between these two systems helps explain why stress, anxiety, and mood disorders so directly affect erections. Anything that suppresses dopamine activity or elevates serotonin’s inhibitory effects can interfere with the brain’s ability to initiate the cascade that leads to blood flow changes in the penis.
The Nervous System’s Role
The spinal cord acts as a relay station and, in some cases, an independent control center. It contains clusters of nerve cells that directly control the blood vessels and muscles involved in erections. The parasympathetic nervous system, the branch associated with rest and relaxation, is the primary pro-erection pathway. It promotes blood vessel dilation and blood trapping. The sympathetic nervous system, associated with stress and alertness, is primarily anti-erection, promoting blood vessel constriction and detumescence.
This is why the classic advice about relaxation isn’t just psychological hand-waving. When sympathetic nervous system activity is high (from stress, performance anxiety, or being in a fight-or-flight state), it actively works against the parasympathetic signals needed to maintain blood flow. The two systems are in direct competition, and the sympathetic system can override arousal signals even when desire is present.
Why Erections Get Harder to Maintain With Age
Erectile difficulty becomes significantly more common as men get older. Among men aged 40 to 60, roughly 16% report erectile dysfunction. That number jumps to about 57% in men aged 60 to 80, based on national health survey data. Overall, about 27% of adult men experience some degree of erectile difficulty.
Age affects nearly every part of the erection process. Blood vessels stiffen and become less responsive to nitric oxide signals. The inner lining of blood vessels produces less nitric oxide in the first place. Testosterone levels decline gradually, weakening the hormonal support for both brain-level arousal and the local chemical signals in penile tissue. Nerve function slows. The smooth muscle in the corpora cavernosa gets partially replaced by fibrous tissue that doesn’t expand as easily.
Cardiovascular health matters enormously here. The arteries supplying the penis are small, so they’re often among the first blood vessels in the body to show the effects of high blood pressure, high cholesterol, or diabetes. Erectile difficulty sometimes appears years before other cardiovascular symptoms, which is why doctors increasingly view it as an early warning sign for broader vascular problems rather than just a standalone issue.

