Brucellosis remains one of the main zoonoses worldwide. Epidemiological data on human brucellosis in Spain are scarce. The objective of this study was to assess the epidemiological characteristics of inpatient brucellosis in Spain between 1997 and 2015. A retrospective longitudinal descriptive study was performed. Data were requested from the Health Information Institute of the Ministry of Health and Equality, which provided us with the Minimum Basic Data Set of patients admitted to the National Health System. We also obtained data published in the System of Obligatory Notifiable Diseases. A total of 5598 cases were registered. The period incidence rate was 0.67 (95% CI 0.65–0.68) cases per 100 000 person-years. We observed a progressive decrease in the number of cases and annual incidence rates. A total of 3187 cases (56.9%) came from urban areas. The group most at risk comprised men around the fifth decade of life. The average (±s.d.) hospital stay was 12.6 days (±13.1). The overall lethality rate of the cohort was 1.5%. The number of inpatients diagnosed with brucellosis decreased exponentially. The group of patients with the highest risk of brucellosis in our study was males under 45 years of age and of urban origin. The lethality rate has reduced to minimum values. It is probable that hospital discharge records could be a good database for the epidemiological analysis of the hospital management of brucellosis and offer a better information collection system than the notifiable diseases system (EDO in Spanish).