What happens when you get an erection?
Erections can happen for a number of reasons, usually because of sexually arousing stimulus and thoughts. The erectile process is complex. It involves nerves and muscles and depends on the blood flow to the penis.
When you are sexually stimulated, messages from the brain cause nerves in your penis to relax and open up the blood vessels in the penis (called corpora cavernosa).
Then, blood from the cavernosal arteries pumps through to fill the blood vessels. As the penis fills with blood, this creates pressure and the penis stiffens and grows in size to create an erection. The membrane which surrounds the corpora cavernosa (the tunica albuginea) traps the blood in the blood vessels, which maintains the erection. When you stop feeling aroused or you ejaculate, the muscles in your penis contract, the blood flows away from the penis and the erection goes down.
Erections usually begin during puberty. They can occur during your sleep and many men have erections first thing in the morning. Erections can last for any time from a few minutes to a longer period, depending on the situation.