Objectives: To evaluate the effect of postoperative use of non-steroidal anti-inflammatory drugs (NSAIDs) on anastomotic leakage requiring reoperation after colorectal resection. Design: Cohort study based on data from a prospective clinical database and electronically registered medical records. Setting: Six major colorectal centres in eastern Denmark. Participants: 2766 patients (1441 (52%) men) undergoing elective operation for colorectal cancer with colonic or rectal resection and primary anastomosis between 1 January 2006 and 31 December 2009. Median age was 70 years (interquartile range 62-77). Intervention: Postoperative use of NSAID (defined as at least two days of NSAID treatment in the first seven days after surgery). Main outcome measures: Frequency of clinical anastomotic leakage verified at reoperation; mortality at 30 days. Results: Of 2756 patients with available data and included in the final analysis, 1871 (68%) did not receive postoperative NSAID treatment (controls) and 885 (32%) did. In the NSAID group, 655 (74%) patients received ibuprofen and 226 (26%) received diclofenac. Anastomotic leakage verified at reoperation was significantly increased among patients receiving diclofenac and ibuprofen treatment, compared with controls (12.8% and 8.2% v 5.1%; P<0.001). After unadjusted analyses and when compared with controls, more patients had anastomotic leakage after treatment with diclofenac (7.8% (95% confidence interval 3.9% to 12.8%)) and ibuprofen (3.2% (1.0% to 5.7%)). But after multivariate logistic regression analysis, only diclofenac treatment was a risk factor for leakage (odds ratio 7.2 (95% confidence interval 3.8 to 13.4), P<0.001; ibuprofen 1.5 (0.8 to 2.9), P=0.18). Other risk factors for anastomotic leakage were male sex, rectal (v colonic) anastomosis, and blood transfusion. 30 day mortality was comparable in the three groups (diclofenac 1.8% v ibuprofen 4.1% v controls 3.2%; P=0.20). Conclusions: Diclofenac treatment could result in an increased proportion of patients with anastomotic leakage after colorectal surgery. Cyclo-oxygenase-2 selective NSAIDs should be used with caution after colorectal resections with primary anastomosis. Large scale, randomised controlled trials are urgently needed.