Purpose: Updated estimates of incidence and prevalence of dementia are crucial to ensure adequate public health policy. However, most of the epidemiological studies in the population in Spain were conducted before 2010. This study assessed the validity of dementia diagnoses recorded in electronic health records contained in a large primary-care database to determine if they could be used for research purposes. Then, to update the epidemiology of dementia in Catalonia (Spain), we estimated crude and standardized prevalence and incidence rates of dementia in Catalonia in 2016. Methods: The System for the Development of Research in Primary Care (SIDIAP) database contains anonymized information for >80% of the Catalan population. Validity of dementia codes in SIDIAP was assessed in patients at least 40 years old by asking general practitioners for additional evidence to support the diagnosis. Crude and standardized incidence and prevalence (95% CI) in people aged ≥65 years were estimated assuming a Poisson distribution. Results: The positive predictive value of dementia diagnoses recorded in SIDIAP was estimated as 91.0% (95% CI 87.5%-94.5%). Age-and sex-standardized incidence and prevalence of dementia were 8.6/1,000 person-years (95% CI 8.0-9.3) and 5.1% (95% CI 4.5%-5.7%), respectively. Conclusion: SIDIAP contains valid dementia records. We observed incidence and prevalence estimations similar to recent face-to-face studies conducted in Spain and higher than studies using electronic health data from other European populations.