Excision of the recto-sigmoid and rectum for cancer or inflammatory disease frequently damages the autonomic nerve supply. The anatomy and function of the autonomic nervous system in the pelvis is reviewed. Thirty-two patients who underwent excision of the rectum have been studied: 28 operations were for carcinoma, 4 for ulcerative colitis. A detailed history of sexual function was obtained preoperatively together with a neurological examination of the genitalia and perineum. Biopsies were taken from the surgical specimens and examined for the presence of nerve tissue. A further sexual history was taken 3 months postoperatively. Ten sexual active men (ages 46-74) who had anterior resections or abdominoperineal excisions for carcinoma tended to show impaired sexual activity if there was excessive nerve tissue in the specimen. Two out of 3 sexually active women (ages 53-68) who had cancer operations had satisfactory sexual function postoperatively. Four patients (ages-66) all had satisfactory sexual function after panproctocolectomy for ulcerative colitis. The advantages of avoiding damages to the pelvic autonomic nerves at operation are discussed.