Median survival of patients with brain metastases from nonsmall cell lung cancer (NSCLC) is poor and more effective treatments are urgently needed. We have evaluated the efficacy of erlotinib in this setting and its association with activating mutations in the epidermal growth factor receptor (EGFR) gene. We retrospectively identified patients with NSCLC and brain metastases treated with erlotinib. EGFR mutations in exons 19 and 21 were analysed by direct sequencing. Efficacy and tolerability were compared according to EGFR mutational status. 69 NSCLC patients with brain metastases were identified, 17 of whom harboured EGFR mutations. Objective response rate in patients with EGFR mutations was 82.4%; no responses were observed in unselected patients (p<0.001). Median (95% CI) time to progression within the brain for patients harbouring EGFR mutations was 11.7 (7.9-15.5) months, compared to 5.8 (5.2-6.4) months for control patients whose EGFR mutational status had not been assessed (p<0.05). Overall survival was 12.9 (6.2-19.7) months and 3.1 (2.5-3.9) months (p<0.001), respectively. The toxicity of erlotinib was as expected and no differences between cohorts were observed. Erlotinib is active in brain metastases from NSCLC; this clinical benefit is related to the presence of activating mutations in exons 19 or 21 of the EGFR gene.