© 2018 BJS Society Ltd Published by John Wiley & Sons Ltd Background: The aim of this study was to assess factors associated with outcomes after surgery for colorectal cancer and to design and internally validate a simple score for predicting perioperative mortality. Methods: Patients undergoing surgery for primary invasive colorectal cancer in 22 centres in Spain between June 2010 and December 2012 were included. Clinical variables up to 30 days were collected prospectively. Multiple logistic regression techniques were applied and a risk score was developed. The Hosmer–Lemeshow test was applied and the area under the receiver operating characteristic (ROC) curve (AUC, with 95 per cent c.i.) was estimated. Results: A total of 2749 patients with a median age of 68·5 (range 24–97) years were included; the male : female ratio was approximately 2 : 1. Stage III tumours were diagnosed in 32·6 per cent and stage IV in 9·5 per cent. Open surgery was used in 39·3 per cent, and 3·6 per cent of interventions were urgent. Complications were most commonly infectious or surgical, and 25·5 per cent of patients had a transfusion during the hospital stay. The 30-day postoperative mortality rate was 1·9 (95 per cent c.i. 1·4 to 2·4) per cent. Predictive factors independently associated with mortality were: age 80 years or above (odds ratio (OR) 2·76), chronic obstructive pulmonary disease (COPD) (OR 3·62) and palliative surgery (OR 10·46). According to the categorical risk score, a patient aged 80 years or more, with COPD, and who underwent palliative surgery would have a 23·5 per cent risk of death within 30 days of the intervention. Conclusion: Elderly patients with co-morbidity and palliative intention of surgery have an unacceptably high risk of death.