An erection happens when blood fills two sponge-like chambers inside the penis and gets trapped there under pressure. The process is a coordinated chain reaction involving your brain, nervous system, blood vessels, and hormones, all working together in a matter of seconds. It looks simple from the outside, but the mechanics underneath are surprisingly complex.
What Triggers the Process
Erections start in two ways, and they use different nerve pathways. A psychogenic erection comes from arousal in the brain: something you see, hear, imagine, or remember. The signals travel down the spinal cord from the mid-back region (levels T11 through L2) to the penis. A reflexogenic erection comes from direct physical touch to the genitals, using a separate set of nerves lower in the spinal cord (levels S2 through S4). Most erections in everyday life involve both pathways firing at once, with mental arousal and physical sensation reinforcing each other.
This distinction matters more than you might think. Men with certain spinal cord injuries can lose one type of erection while keeping the other, depending on where the damage is. It’s evidence that the two pathways are genuinely independent circuits, not just different flavors of the same signal.
The Chemical Chain Reaction
Once the nervous system sends its “go” signal, the key molecule that makes everything happen is nitric oxide. Nerve endings and blood vessel linings in the penis both release it. Nitric oxide triggers an enzyme that produces a second chemical messenger called cGMP, and cGMP is what actually does the heavy lifting.
cGMP tells the smooth muscle cells lining the penile arteries and internal chambers to relax. It does this by lowering the calcium concentration inside those cells. When calcium drops, the muscle fibers loosen, the arteries widen, and blood rushes in. Measurements of penile arteries show the vessels expand by about 72% in diameter during this process, with blood flow velocity increasing roughly 200%. That’s a dramatic shift happening in a very small space.
How Blood Gets Trapped
Increased blood flow alone wouldn’t produce rigidity. The penis needs a way to hold that blood in place under pressure, and that’s where its internal architecture comes in. The two main erectile chambers, called the corpora cavernosa, are wrapped in a tough, fibrous sheath. As the chambers fill and expand, they press outward against this sheath, which compresses the small veins that normally drain blood out of the penis. Those veins run between layers of the sheath, so when the tissue swells, the exit routes get squeezed shut.
This creates a hydraulic lock. Blood flows in through the arteries, which are actively dilated, but can’t flow out through the veins, which are physically compressed. Pressure builds inside the chambers, and the penis becomes rigid. The sheath itself provides both the flexibility to allow expansion and the structural strength to maintain high-pressure rigidity once full.
How an Erection Ends
The return to a soft state is an active process, not just the absence of arousal. When nerve stimulation slows down and nitric oxide release drops off, an enzyme called PDE5 starts breaking down the cGMP that was keeping the smooth muscle relaxed. PDE5 is the dominant version of this enzyme in penile tissue, which is exactly why erectile dysfunction medications target it. Those drugs block PDE5 from doing its job, allowing cGMP to stick around longer and keep blood flow going.
During ejaculation, the sympathetic nervous system fires a burst of activity that speeds up the process. The smooth muscle contracts, the arteries narrow, blood drains out through the now-uncompressed veins, and the penis returns to its resting state.
The Role of Testosterone
Testosterone doesn’t directly cause erections, but it sets the stage for them. It maintains sex drive, keeps penile tissue healthy, and supports the nerve signaling that makes the whole process possible. The American Urological Association defines low testosterone as below 300 nanograms per deciliter, a threshold where men commonly start experiencing symptoms like reduced desire and weaker erections. Some men become symptomatic even above that cutoff, though, so the number isn’t a hard line.
Think of testosterone as the baseline supply level. If it drops too low, the entire system works less efficiently. Arousal signals from the brain are weaker, the chemical chain reaction is sluggish, and the tissue itself may not respond as well. But within a normal range, more testosterone doesn’t necessarily mean stronger erections.
Erections During Sleep
If you’ve ever woken up with an erection, that’s not random. Sleep-related erections happen in a repeating cycle tied to REM sleep, the phase associated with dreaming. In a healthy young man, an erection typically begins near the onset of each REM episode, reaches full rigidity, persists throughout the episode, and fades quickly when REM ends. Since most people cycle through REM several times per night, this means multiple erections happen while you’re asleep.
These erections occur in all sexually healthy males from infancy through old age. The exact brain mechanism driving them is still not fully understood, but they appear to be controlled by different pathways than either psychogenic or reflexogenic erections. They’re not caused by sexual dreams. The prevailing theory is that they serve a maintenance function, periodically oxygenating the erectile tissue and keeping it elastic. Clinically, they’re also useful as a diagnostic tool: if a man can get erections during sleep but not while awake, the underlying plumbing works fine, and the issue is more likely psychological or neurological.
How Aging Changes the Process
The basic mechanism stays the same throughout life, but the speed and reliability shift. Older men generally need more time and more direct physical stimulation to reach a full erection. Every phase of the sexual response cycle slows down: arousal takes longer, the plateau phase extends, and the recovery period after orgasm stretches significantly.
Several things contribute to this. Blood vessels stiffen with age, reducing the speed and volume of blood flow. Testosterone levels gradually decline. The smooth muscle in the erectile chambers slowly gets replaced by less elastic connective tissue. None of these changes mean erections stop. They mean the system needs more input and more time to produce the same output. Physical health factors like cardiovascular fitness, blood pressure, and blood sugar levels have an outsized influence on erectile function as men age, because the process is fundamentally a vascular event. What’s good for your arteries is good for your erections.