Surgery is a widely accepted treatment option for drug-resistant focal epilepsy. A detailed analysis of longitudinal postoperative seizure outcomes and use of antiepileptic drugs for different brain lesions causing epilepsy is not available. We aimed to analyse the association between histopathology and seizure outcome and drug freedom up to 5 years after epilepsy surgery, to improve presurgical decision making and counselling.In this retrospective, multicentre, longitudinal, cohort study, patients who had epilepsy surgery between Jan 1, 2000, and Dec 31, 2012, at 37 collaborating tertiary referral centres across 18 European countries of the European Epilepsy Brain Bank consortium were assessed. We included patients of all ages with histopathology available after epilepsy surgery. Histopathological diagnoses and a minimal dataset of clinical variables were collected from existing local databases and patient records. The primary outcomes were freedom from disabling seizures (Engel class 1) and drug freedom at 1, 2, and 5 years after surgery. Proportions of individuals who were Engel class 1 and drug-free were reported for the 11 main categories of histopathological diagnosis. We analysed the association between histopathology, duration of epilepsy, and age at surgery, and the primary outcomes using random effects multivariable logistic regression to control for confounding.9147 patients were included, of whom seizure outcomes were available for 8191 (89·5%) participants at 2 years, and for 5577 (61·0%) at 5 years. The diagnoses of low-grade epilepsy associated neuroepithelial tumour (LEAT), vascular malformation, and hippocampal sclerosis had the best seizure outcome at 2 years after surgery, with 77·5% (1027 of 1325) of patients free from disabling seizures for LEAT, 74·0% (328 of 443) for vascular malformation, and 71·5% (2108 of 2948) for hippocampal sclerosis. The worst seizure outcomes at 2 years were seen for patients with focal cortical dysplasia type I or mild malformation of cortical development (50·0%, 213 of 426 free from disabling seizures), those with malformation of cortical development-other (52·3%, 212 of 405 free from disabling seizures), and for those with no histopathological lesion (53·5%, 396 of 740 free from disabling seizures). The proportion of patients being both Engel class 1 and drug-free was 0-14% at 1 year and increased to 14-51% at 5 years. Children were more often drug-free; temporal lobe surgeries had the best seizure outcomes; and a longer duration of epilepsy was associated with reduced chance of favourable seizure outcomes and drug freedom. This effect of duration was evident for all lesions, except for hippocampal sclerosis.Histopathological diagnosis, age at surgery, and duration of epilepsy are important prognostic factors for outcomes of epilepsy surgery. In every patient with refractory focal epilepsy presumed to be lesional, evaluation for surgery should be considered.None.