How an Erection Happens: Blood, Nerves, and Chemistry

An erection is a coordinated event involving your nervous system, blood vessels, hormones, and specialized tissue inside the penis. It starts with a signal, either from the brain or from physical touch, that triggers a chemical chain reaction. That reaction relaxes muscle tissue inside the penis, allows blood to rush in, and then traps that blood in place until the process reverses. The whole sequence takes seconds, but the biology behind it is surprisingly intricate.

Three Types of Erections

Not all erections start the same way. There are three distinct types, each triggered through a different pathway.

Psychogenic erections begin in the brain. Something you see, hear, smell, or imagine sends signals down the spinal cord to two erection centers: one in the mid-to-lower back (segments T11 through L2) and another in the lower sacral spine (S2 through S4). From there, nerves called the cavernous nerves carry the signal to the penis.

Reflexogenic erections start with direct physical touch to the genitals. Sensory nerves carry that signal to the sacral spinal cord (S2 through S4), which activates the same cavernous nerves without necessarily involving the brain at all. This is a spinal reflex, which is why it can happen even during sleep or without conscious arousal.

Nocturnal erections occur during REM sleep, the phase when most dreaming happens. Healthy men typically experience several per night, and their frequency gradually decreases with age. These erections aren’t necessarily tied to sexual dreams. They appear to be a routine maintenance function of the nervous system.

The Chemical Chain Reaction

Regardless of which type of signal starts the process, the same chemical sequence unfolds inside the penis. The key player is nitric oxide, a small molecule released by nerve endings and the lining of blood vessels in the erectile tissue.

Once released, nitric oxide passes into the smooth muscle cells that line the blood vessels and spongy chambers of the penis. Inside those cells, it activates an enzyme that produces a signaling molecule called cGMP. This is the molecule that actually does the work. cGMP triggers a cascade that opens potassium channels in the muscle cell walls, which changes the electrical charge across the membrane. That shift causes calcium to be pulled out of the cell and blocks new calcium from entering. Since calcium is what keeps smooth muscle contracted, removing it causes the muscle to relax.

Think of it this way: the muscle cells lining penile blood vessels are normally in a state of mild contraction, keeping the penis soft. Nitric oxide flips the switch that tells those muscles to let go.

How Blood Fills and Stays Trapped

The penis contains two cylindrical chambers called the corpora cavernosa, which run along its length. These chambers are filled with a network of tiny blood-filled spaces, similar to a sponge. When the smooth muscle relaxes, arteries widen and blood pours into these spaces, expanding them rapidly.

Here’s what makes an erection firm rather than just swollen: surrounding each chamber is a tough, fibrous sheath called the tunica albuginea. This layer doesn’t stretch much. As the spongy tissue inside swells with blood, it presses outward against this rigid sheath. Small veins that normally drain blood out of the penis run between the expanding tissue and the tunica albuginea, and they get physically compressed, like a garden hose pinched between two hard surfaces.

This trapping mechanism is what maintains rigidity. Blood flows in through the arteries but can’t easily flow back out through the compressed veins. The result is sustained pressure inside the chambers, producing firmness. Clinically, full rigidity is graded on a simple 4-point scale: 1 means the penis enlarges but isn’t hard, 2 means it’s hard but not firm enough for penetration, 3 is firm enough for penetration but not completely rigid, and 4 is fully hard.

How an Erection Ends

The erection reverses when the signaling molecule cGMP gets broken down. An enzyme called PDE5, which is always present in penile tissue, steadily converts cGMP into an inactive form. Once arousal signals from the brain or body slow down, nitric oxide production drops, less cGMP is made, and PDE5 clears out what remains. Calcium floods back into the smooth muscle cells, the muscles contract again, arteries narrow, and the veins reopen. Blood drains out, and the penis returns to its soft state.

This is also why common erectile dysfunction medications work. They block PDE5, slowing the breakdown of cGMP so that whatever nitric oxide the body produces has a longer, stronger effect. They don’t create arousal on their own. They amplify the chemical process that’s already underway.

The Role of Testosterone

Testosterone doesn’t directly cause erections, but it plays an important background role. It helps regulate the production of nitric oxide synthase, the enzyme responsible for making nitric oxide in penile tissue. When testosterone levels drop significantly, the body produces less nitric oxide, which means the entire chemical cascade starts from a weaker position. Low testosterone is also linked to higher levels of a compound that actively blocks nitric oxide production, creating a double disadvantage. This is one reason erectile difficulties sometimes accompany low testosterone, even when blood vessels and nerves are otherwise healthy.

The Nervous System’s Dual Role

Your autonomic nervous system, the part that runs involuntary functions like heart rate and digestion, controls both the start and end of erections through two opposing branches. The parasympathetic branch, originating from the sacral spinal cord (S2 through S4), drives the erection process. It sends signals through the pelvic plexus and the cavernous nerves to initiate nitric oxide release and smooth muscle relaxation.

The sympathetic branch, originating higher up in the spine around T11 through T12, does the opposite. It promotes detumescence, the return to a flaccid state. This is why stress, anxiety, or a sudden adrenaline surge (all sympathetic responses) can cause an erection to fade quickly. The two systems are in a constant push-pull relationship, and erections happen when the parasympathetic side wins out.

Spinal cord injuries reveal how distinct these pathways are. Men with damage to the lower sacral cord often lose the ability to get reflexogenic erections from touch but can still achieve psychogenic erections from mental arousal, because the sympathetic outflow pathway at T11 through L2 remains intact. Men with injuries above T9, on the other hand, typically lose psychogenic erections entirely because signals from the brain can no longer reach either spinal erection center.

How Erections Change With Age

Erectile function shifts gradually over a man’s lifetime. In a 12-year study tracking 189 men from age 50 onward, about 54.5% experienced some decline in function over that period, while 39.2% reported no change and 6.3% actually improved. Among men who had normal erections at the start of the study, roughly 39% still had normal function 12 years later.

Age makes a significant difference in the trajectory. Among men aged 50 to 54 at baseline, about 53% saw a decline over 12 years. By ages 65 to 69, that number rose to 77%. For men between 70 and 75, nearly 86% experienced a decrease, and by age 75, all participants had at least mild erectile changes. Nocturnal erections also become less frequent and shorter in duration with age, though the degree of firmness during those episodes doesn’t necessarily change.

These shifts reflect the cumulative effects of aging on the vascular and nervous systems: blood vessels stiffen, nitric oxide production decreases, and nerve signaling slows. Cardiovascular health, physical activity, and mental health all influence the pace of these changes, which is why the timeline varies so much between individuals.