Background Postoperative infection is a common complication in hip fracture patients and the risk appears to have increased during the last decade. However, the impact of infection on mortality after hip fracture surgery remains unclear. Purpose We aimed to examine the association between infection (any, as well as specific infections), with all-cause mortality following hip fracture surgery. Methods Using Danish nationwide registries, we conducted a population-based cohort study on 74,771 hip fracture patients ≥65 years old operated from 2005 to 2016. We included hospital-treated infection as a time-varying exposure, and calculated 30-days mortality rate per 1000 person-years (PY). We used time-varying Cox Proportional Hazard Regression...