When the penis fills with blood and is rigid. The penis contains two chambers, called the corpora cavernosa, which run the length of the organ, are filled with spongy tissue, and surrounded by a membrane, called the tunica albuginea. The spongy tissue contains smooth muscles, fibrous tissues, spaces, veins, and arteries. The urethra, which is the channel for urine and ejaculate, runs along the underside of the corpora cavernosa. Erection begins with sensory and mental stimulation. Impulses from the brain and local nerves cause the muscles of the corpora cavernosa to relax, allowing blood to flow in and fill the open spaces. The blood creates pressure in the corpora cavernosa, making the penis expand. The tunica albuginea helps to trap the blood in the corpora cavernosa, thereby sustaining erection. Erection is reversed when muscles in the penis contract, stopping the inflow of blood and opening outflow channels.