How Does a Man Get an Erection: What Happens Inside

An erection happens when blood fills two spongy chambers inside the penis and gets trapped there under pressure. The process is a chain reaction involving your brain, spinal cord, nerves, blood vessels, and hormones, all working together in a sequence that takes only seconds. Understanding how it works also helps explain why erections sometimes don’t cooperate.

Two Ways an Erection Starts

There are two distinct pathways that trigger an erection, and they originate from different parts of the nervous system.

A psychogenic erection starts in the brain. Visual input, sounds, fantasies, or emotional arousal send signals down through the spinal cord, specifically through segments in the mid-to-lower back (T11 through L2). From there, nerve signals travel to the penis. This is why simply thinking about something arousing can produce an erection without any physical contact.

A reflexogenic erection starts from direct physical stimulation of the genitals. Touch receptors in the skin send signals to a lower part of the spinal cord (S2 through S4), which loops the signal right back to the penis through a reflex arc. This type doesn’t require any input from the brain at all, which is why men with certain spinal cord injuries above that level can still get erections from touch even if they’ve lost sensation.

In most real-world situations, both pathways work together. Physical stimulation and mental arousal reinforce each other, which is why distraction or anxiety can interfere even when physical stimulation is present.

What Happens Inside the Penis

Once nerve signals reach the penis, they trigger a chemical cascade. Nerve endings release a gas called nitric oxide, a powerful signaling molecule that tells the smooth muscle lining the penile arteries to relax. That relaxation is the key event. When those muscles loosen, the arteries widen dramatically and blood rushes into two cylindrical chambers called the corpora cavernosa, which run the length of the penis.

Nitric oxide works by activating an enzyme that produces a second messenger molecule (cyclic GMP) inside smooth muscle cells. Cyclic GMP is what directly causes the muscle fibers to unclench. As blood floods into the expanding spongy tissue, the swelling chambers compress the veins that would normally drain blood out of the penis. This trapping mechanism is what creates and maintains rigidity. The penis essentially becomes a pressurized hydraulic system.

The process has a built-in amplification step. The initial nerve-driven burst of nitric oxide relaxes muscle and increases blood flow. That increased blood flow then activates a second source of nitric oxide from the cells lining the blood vessels themselves. The two sources work together synergistically to produce and sustain a full erection.

How an Erection Ends

An erection doesn’t just fade on its own. An enzyme called PDE5 actively breaks down cyclic GMP, the molecule keeping the smooth muscle relaxed. As cyclic GMP levels drop, the smooth muscle contracts again, the arteries narrow, blood flow decreases, and the trapped blood drains out through the veins. The penis returns to its soft state.

This enzyme is the target of erectile dysfunction medications. Those drugs block PDE5, which slows the breakdown of cyclic GMP and helps maintain the erection longer. They don’t create an erection from nothing. They simply make it easier for the natural process to work once arousal triggers nitric oxide release. When PDE5 doesn’t function properly, cyclic GMP can build up unchecked, which in rare cases leads to priapism, a prolonged erection that becomes a medical emergency because trapped blood loses oxygen.

The Role of Testosterone

Testosterone doesn’t directly cause erections, but it plays a critical supporting role. It helps maintain the health of erectile tissue and influences how much nitric oxide the body produces. Animal studies have shown that removing testosterone reduces nitric oxide synthase activity in the penis by about 45%, and replacing the hormone prevents that decline. Low testosterone can also reduce libido, which weakens the psychogenic pathway. So while testosterone isn’t part of the immediate chain reaction, it sets the stage for the whole system to function properly.

Erections During Sleep

Healthy men get erections during REM sleep, the phase associated with dreaming. These nocturnal erections happen automatically and have nothing to do with sexual dreams. A typical night includes several REM cycles, and men can experience up to five erections per night, each lasting 20 to 30 minutes.

These sleep erections are thought to help maintain erectile tissue health by regularly oxygenating it with fresh blood flow. They’re also clinically useful: if a man has erections during sleep but not while awake, it suggests the physical plumbing works fine and the issue is more likely psychological or situational.

How Erections Change With Age

Erectile function shifts gradually over a man’s lifetime. In younger men, erections tend to happen quickly, reach full rigidity, and can recover faster after ejaculation. With age, it typically takes more direct stimulation to get an erection, the erection may be less rigid, and the refractory period (the time before another erection is possible) gets longer.

Erectile dysfunction affects roughly 50 percent of men over 40, and the prevalence increases with each decade. The causes are usually cumulative: blood vessels stiffen, blood flow decreases, nerve sensitivity declines, and testosterone levels drop slowly (about 1 to 2 percent per year after age 30). Conditions like high blood pressure, diabetes, and cardiovascular disease accelerate these changes because they directly damage the blood vessels and nerves the erection process depends on.

Occasional difficulty getting or keeping an erection is normal at any age, especially during stress, fatigue, or after alcohol use. It becomes a clinical concern when it’s persistent enough to interfere with sexual satisfaction, particularly if erections are consistently too soft for penetration or don’t last long enough.