Penile erection is a physiological phenomenon where the penis
Human penis
The human penis is an external sexual organ of male humans. It is a reproductive, intromittent organ that additionally serves as the urinal duct.-Parts:...

 becomes enlarged and firm. Penile erection is the result of a complex interaction of psychological, neural, vascular and endocrine factors, and is usually, though not exclusively, associated with sexual arousal
Sexual arousal
Sexual arousal, or sexual excitement, is the arousal of sexual desire, during or in anticipation of sexual activity. Things that precipitate human sexual arousal are called erotic stimuli, or colloquially known as turn-ons. There are many potential stimuli, both physical or mental, which can cause...

. In some males, erection can occur spontaneously at any time of day, and is known as nocturnal penile tumescence
Nocturnal penile tumescence
Nocturnal penile tumescence is the spontaneous occurrence of an erection of the penis during sleep. All men without physiological erectile dysfunction experience this phenomenon, usually three to five times during the night...

 when occurring during rapid eye movement sleep.
Penile erection occurs when two tubular structures that run the length of the penis, the corpora cavernosa
Corpus cavernosum penis
The corpus cavernosum penis is one of a pair of sponge-like regions of erectile tissue which contain most of the blood in the penis during penile erection...

, become engorged with venous blood
Venous blood
Venous blood is deoxygenated blood in the circulatory system. It runs in the systemic veins from the organs to the heart. Deoxygenated blood is then pumped by the heart to lungs via the pulmonary arteries, one of the few arteries in the body that carries deoxygenated blood .Venous blood is...