Damage to nerves that supply the prostate and other pelvic organs can also cause impotence. Strokes can damage parts of the brain that send messages via nerves to the penis. Prostate surgery, especially removal of the prostate for cancer (radical total prostatectomy) damages the nerves that control erection in the majority of patients, although newer surgical techniques can lower the chances that damage to these nerves will happen.
Multiple sclerosis is a disease of the nerves affecting the brain and spinal cord. It can cause impotence, as can spinal cord injuries that damage the nerves leading to the penis that control erection.