Little information is available on the clinical significance of cancer‐related genes such as KRAS, NRAS, BRAF, PIK3CA and TP53 in nonmetastatic rectal cancer. We investigated mutations of these genes in a large prospective series of locally advanced rectal cancer (LARC) patients who were recruited into two phase II trials. Mutational analyses were performed with diagnostically validated methods including polymerase chain reaction, capillary electrophoresis single‐strand conformational analysis, Sanger sequencing and next‐generation sequencing. Associations between single or multiple gene mutations and clinicopathological characteristics and treatment outcomes were explored. Of these 269, 210 (78%) patients were assessable. Mutations of KRAS, NRAS, BRAF, PIK3CA and TP53 occurred in 43, 9, 4, 9 and 60% of patients, respectively. Concordance between paired biopsy and resection specimens was 82% for KRAS, 95% for NRAS, 99% for BRAF, 96% for PIK3CA and 63% for TP53. TP53 mutations were associated with extramural venous invasion on baseline MRI (78% vs. 65%, p = 0.04), poor pathological tumour regression (23% vs. 36%, p = 0.05) and a trend toward a worse 5‐year progression‐free survival (PFS; 60% vs. 74%, HR 1.59, p = 0.06). Patients with tumours harbouring mutation of TP53 and either KRAS or NRAS (32%) had a worse 5‐year PFS than those with TP53/KRAS/NRAS wild‐type tumours (54% vs. 72%, HR 1.75, p = 0.02). In univariate analysis, BRAF mutation predicted poor 5‐year overall survival only among patients treated without cetuximab (20% vs. 73%, HR 3.29, p = 0.03). This is one of the largest biomarker studies in a prospective, largely homogeneous, LARC population. Our findings are hypothesis generating and require validation in independent series.