The erect penis is commonly correlated with male sexual arousal.
Physiological Effects of Arousal
Physical and/or psychological stimulation leads to vasodilation and subsequent increased blood flow into the three spongy areas that run along the length of the penis (the two corpora cavernosa and the corpus spongiosum). The penis grows enlarged and firm, the skin of the scrotum is pulled tighter, and the testes are pulled up against the body.
As sexual arousal and stimulation continues, the glans of the erect penis will swell wider. As the genitals become further engorged with blood, their color deepens and the testes can grow up to 50% larger. As the testes continue to rise, a feeling of warmth may develop around them and the perineum. With further sexual stimulation, the heart rate increases, blood pressure rises, and breathing becomes more rapid. The increase in blood flow in the genitals and other regions may lead, in some men, to a sex flush.
The muscles of the pelvic floor, the ductus deferens (between the testes and the prostate), the seminal vesicles, and the prostate gland may begin to contract in a way that forces sperm and semen into the urethra inside the penis. This is the onset of orgasm and once this has started, the man likely will continue to ejaculate and orgasm fully, with or without further stimulation. If sexual stimulation stops before orgasm, the physical effects of the stimulation, including the vasocongestion, will subside in a short time. Repeated or prolonged stimulation without orgasm and ejaculation can lead to discomfort in the testes that is sometimes called "blue balls."
Nonarousal-Related Erection
The relationship between erection and arousal is not one-to-one. Some men older than age 40 report that they do not always have an erection when sexually aroused. A male erection can occur during sleep (nocturnal penile tumescence) without conscious sexual arousal or due to mechanical stimulation (e.g. rubbing against a bed sheet) alone. A young man or one with a strong sexual drive may experience enough sexual arousal for an erection with a passing thought or just the sight of a passerby. Once erect, his penis may gain enough stimulation from contact with the inside of his clothing to maintain the erection for more time.
Post-Orgasm Response
After orgasm and ejaculation, a refractory period usually ensues, characterized by loss of erection, a decline in any sex flush, decreased interest in sex, and a feeling of relaxation associated with the action of the neurohormones oxytocin and prolactin. The intensity and duration of the refractory period can be very short in a highly aroused young man in a highly-arousing situation, perhaps without even a noticeable loss of erection. It can be as long as a few hours or days in mid-life and older men.
Hormonal Responses
Several hormones affect sexual arousal, including testosterone, cortisol, and estradiol. However, the specific roles of these hormones are not clear. Testosterone is the most commonly-studied hormone involved with sexuality, and it plays a key role in sexual arousal in males, with strong effects on central arousal mechanisms.