This study aimed to identify risk factors for long-term sexual dysfunction (SD) after rectal cancer treatment. Patients with resectable rectal cancer were randomised to total mesorectal excision with or without preoperative radiotherapy (PRT). Preoperatively and at 3, 6, 12, 18 and 24 months postoperatively, SD scores were filled out in questionnaires. Possible risk factors for postoperative deterioration of sexual functioning, including patients' demographics, tumour-specific factors and treatment-related variables, were investigated with univariate and multivariable regression analyses. Increase in general SD, erectile dysfunction and ejaculatory problems were reported by 76.4, 79.8 and 72.2 percent of the male patients, respectively. Risk factors were nerve damage, blood loss, anastomotic leakage, PRT and the presence of a stoma. In female patients, increase in general SD, dyspareunia and vaginal dryness were reported by 61.5, 59.1 and 56.6 percent, respectively. This was associated with PRT and the presence of a stoma. SD occurs frequently after rectal cancer treatment and is caused by surgical (nerve) damage with an additional effect of PRT. Patients should be informed preoperatively, and education of surgeons in neuroanatomy may provide the key to the improvement of functional outcome.