In the penis there are two long, thin chambers filled with spongy tissue called the corpora cavernosa . They are normally empty and relatively dry. An erection is brought about by blood that rushes in from the penile arteries, thereby engorging the erectile tissue and causing the penis to expand. As arterial flow increases and venous outflow decreases, the penis at first becomes enlarged, and then fully rigid. This is brought about by reflex action stimulated by the brain though the central nervous system, or through tactile stimulation of sensory nerve endings of erogenous zones.
Blood is trapped in the penile chambers by valves.
Testosterone, secreted by the Leydig cells of the penis, facilitates penile erection through an unknown mechanism.