Sexual arousal or other stimulation sends messages from the brain to the nerves around the penis, causing the muscles to relax and letting blood flow into the penile arteries. This fills and stiffens the spongy columns of tissues inside the penis shaft, creating an erection.