An erection happens when blood rapidly fills two sponge-like chambers inside the penis, then gets trapped there under pressure. The process involves your nervous system, blood vessels, hormones, and a specific chemical chain reaction that relaxes the muscle tissue inside the penis to let blood rush in. What seems like a simple physical response is actually a precisely coordinated sequence with five distinct phases.
The Basic Anatomy
The penis contains two cylindrical chambers called the corpora cavernosa that run along its length. These chambers are made of spongy tissue filled with tiny spaces (similar to a kitchen sponge) surrounded by smooth muscle. Wrapped around the outside is a tough, elastic sheath made of collagen and elastic fibers. This outer sheath plays a critical role: when the chambers fill with blood and expand, the sheath stretches only so far, then compresses the small veins running just beneath it. That compression traps the blood inside, which is what actually creates and maintains the firmness.
Inside the chambers, small pillars of tissue radiate inward from the outer sheath, providing structural support. Think of them as internal scaffolding. When everything is working properly, roughly 40% of the tissue inside these chambers is smooth muscle. That ratio matters because the muscle needs to relax and expand enough to squeeze the drainage veins shut. When that muscle tissue is replaced by stiffer, fibrous tissue (which can happen with age or certain health conditions), the chambers can’t expand enough to trap blood effectively.
Two Pathways That Trigger an Erection
Erections can start from two completely different triggers, each using its own nerve pathway. Psychogenic erections come from the brain. Something you see, hear, imagine, or remember sends signals down the spinal cord from roughly the mid-back region (spinal levels T11 through L2) to the blood vessels in the penis. Reflexogenic erections come from direct physical touch to the genitals, with signals traveling through a lower section of the spinal cord (levels S2 through S4) without needing any input from the brain at all.
This distinction explains something that might seem counterintuitive: men with certain spinal cord injuries above the mid-back can still get erections from physical touch, even though they’ve lost the ability to get erections from mental arousal. The two pathways are independent. In everyday life, most erections involve both pathways working together, with mental arousal and physical sensation reinforcing each other.
The Chemical Chain Reaction
Once nerve signals reach the penis, the actual mechanism that produces an erection is chemical. Nerve endings release a gas called nitric oxide directly into the smooth muscle tissue of the corpora cavernosa. Nitric oxide triggers the production of a signaling molecule (cGMP) inside the muscle cells. This molecule activates a cascade that opens specific channels in the cell walls, allowing the smooth muscle to relax.
That relaxation is the key event. When the smooth muscle in the walls of the penile arteries and inside the spongy chambers relaxes, blood flow increases dramatically. Studies using ultrasound measurements show that arterial diameter increases by about 72%, and blood flow velocity roughly triples during the transition from soft to erect. Blood pours into the expanding spongy tissue, filling the tiny spaces like water filling a sponge.
Five Phases From Soft to Rigid
The full process unfolds in five recognized phases. During the latent phase, nerve signals have fired but nothing visible has happened yet. Blood flow starts to increase, but the chambers haven’t begun to fill noticeably. This initial delay lasts roughly 10 seconds after nerve stimulation begins.
In the tumescent phase, blood is actively filling the chambers and the penis begins to lengthen and enlarge. Pressure inside the chambers starts climbing from its resting level of about 30 mmHg. During full erection, the chambers are substantially engorged and internal pressure has risen significantly, but the penis isn’t at maximum firmness yet. The rigid erection phase follows, where pressure peaks at around 106 mmHg, more than three times the resting level. At this point, the outer sheath is stretched taut, the drainage veins are fully compressed, and very little blood is escaping.
The final phase, detumescence, is how the penis returns to its soft state.
How the Erection Ends
The same chemical pathway that creates an erection also contains a built-in off switch. An enzyme inside the smooth muscle tissue steadily breaks down cGMP, the signaling molecule responsible for keeping the muscle relaxed. As cGMP levels drop, the smooth muscle contracts again, squeezing blood out of the chambers. The drainage veins reopen, pressure drops, and the penis returns to its resting state.
This enzyme works through a feedback loop: the more cGMP present, the more active the enzyme becomes. So the system is always working toward returning to baseline. An erection persists only as long as nerve signals keep producing enough nitric oxide to generate new cGMP faster than the enzyme can break it down. When arousal fades or stimulation stops, the enzyme wins and the erection subsides. This is also why medications for erectile dysfunction work the way they do: they block this enzyme, allowing cGMP to accumulate more easily and stick around longer.
The Role of Testosterone
Testosterone doesn’t directly cause erections, but it sets the stage for them. In the brain, testosterone increases the production of nitric oxide in a region involved in sexual motivation. That nitric oxide boosts the release of dopamine, a chemical messenger linked to desire and arousal. So testosterone essentially primes the brain’s interest in sex, which then triggers the nerve signals that start the whole process.
Testosterone also appears to maintain the health of the erectile tissue itself. Men with low testosterone often have reduced nitric oxide production both in the brain and in the penile tissue, making it harder for the chemical chain reaction to get started. This is why low testosterone can contribute to erectile difficulties even when blood vessels and nerves are otherwise healthy.
Why Erections Happen During Sleep
Most men experience three to five erections per night during REM sleep, each lasting about 25 to 35 minutes. These nocturnal erections happen without any sexual stimulation or conscious arousal. They appear to be triggered by shifts in brain activity during REM sleep that activate the same nerve pathways involved in waking erections, while the brain regions that normally inhibit arousal go quiet.
Nocturnal erections serve as a useful diagnostic signal. If a man has difficulty getting erections while awake but still gets them during sleep, it suggests the blood vessels and nerves are working fine and the issue is more likely psychological or related to stress. If nocturnal erections are also absent, it points toward a physical cause like nerve damage, blood vessel disease, or hormonal changes.

