Erection is the hardening, enlarging and rising of the penis which often occurs in the sexually aroused male. Erection enables sexual intercourse and some other sexual activities, though it is not essential for all of them.

In addition to sexual arousal, erection can be caused by friction or by the pressure of the filled urinary bladder. In healthy males, erections occur several times per night during sleep, and morning erections when waking up are common. Erections already occur in infant boys.

Physiologically, an erection is achieved by two mechanisms that play together: increased inflow of blood into the vessels of erectile tissue, and decreased outflow. The vessel system involved is known as the corpora cavernosa and the corpus spongiosum. After a signal from the sympathetic nervous system, muscles in the region relax, allowing more blood to enter the sponge-like tissues. Contraction of other muscles reduce the outflow. The enlarged structure then exerts pressures on the exit vein, further reducing the outflow.

As blood flows in, the penis stiffens, its girth and length increases, and it rises to an angle that can vary from horizontal to almost vertical. Normally, the foreskin retracts and exposes the glans.

When the erection mechanism fails to function properly, the result is impotence. Impotence in humans is treated with prosthetic devices, and with prescription drugs. Some prescription drugs are injected directly into the corpus cavernosum or used as urethral suppositories, directly causing erection even in the absence of sexual excitation, while others, such as Viagra, are taken orally and support erection that is due to sexual excitation.

Both an erection and the absence of an erection can be embarrassing, depending on circumstances.

An erection may be embarrassing:

  • if the man or boy does not want to reveal that he is sexually aroused
  • if the erection is not caused by sexual arousal, but just by friction etc., and the man or boy does not want to create the wrong impression that he is sexually aroused
  • in a situation where an erection is inappropriate, such as in a classroom or a public place.

Not having an erection may be embarrassing:
  • if a man or boy is with a partner and it wrongly creates the impression that he does not find the other person attractive

Also it may be disappointing for the partner because he or she finds an erection attractive, and disappointing for both for being limited in sexual activities.

In several countries, movies and magazines available to juveniles may not depict erections; such depictions are often taken as one criterion to distinguish between soft and hard pornography.

Erections may occur even after death, if the pressure within the penis increases for some reason, for example due to the formation of gases of putrefaction.

The clitoris of females also contains erectile tissue and may become erect during sexual arousal; the erection of nipples however is not due to erectile tissue.