Background: Surveillance for healthcare-associated infections such as healthcareassociated urinary tract infections (HA-UTI) is important for directing resources and evaluating interventions. However, traditional surveillance methods are resourceintensive and subject to bias. Aim: To develop and validate a fully automated surveillance algorithm for HA-UTI using electronic health record (EHR) data. Methods: Five algorithms were developed using EHR data from 2979 admissions at Karolinska University Hospital from 2010 to 2011: (1) positive urine culture (UCx); (2) positive UCx þ UTI codes (International Statistical Classification of Diseases and Related Health Problems, 10 th revision); (3) positive UCx þ UTI-specific antibiotics; (4) positive UCx þ fever and/or UTI symptoms; (5) algorithm 4 with negation for fever without UTI symptoms. Natural language processing (NLP) was used for processing free-text medical notes. The algorithms were validated in 1258 potential UTI episodes from January to March 2012 and results extrapolated to all UTI episodes within this period (N ¼ 16,712). The reference standard for HA-UTIs was manual record review according to the European Centre for Disease Prevention and Control (and US Centers for Disease Control and Prevention) definitions by trained healthcare personnel. Findings: Of the 1258 UTI episodes, 163 fulfilled the ECDC HA-UTI definition and the algorithms classified 391, 150, 189, 194, and 153 UTI episodes, respectively, as HA-UTI. Algorithms 1, 2, and 3 had insufficient performances. Algorithm 4 achieved better performance and algorithm 5 performed best for surveillance purposes with sensitivity 0.667 (95% confidence interval: 0.594e0.733), specificity 0.997 (0.996e0.998), positive predictive value 0.719 (0.624e0.807) and negative predictive value 0.997 (0.996e0.997).