Background: Diabetes mellitus is a risk factor for infection with Staphylococcus aureus, but it is unclear whether S. aureus infection is a prediabetic condition. Methods: Nationwide population-based matched cohort study. Incidence rate and ratio with 95% confidence interval of diabetes were estimated by negative binomial regression. Results: Of 19,988 individuals with S. aureus bacteraemia and 185,579 population comparators, 667 and 4974 had a primary diagnose of diabetes within five years after discharge of S. aureus bacteraemia corresponding to a more than double risk of diabetes (adjusted incidence rate ratio 2.28 (95% confidence interval: 2.10-2.46)). Other factors associated with an increased risk of diabetes during follow-up were male sex, increasing age and level of comorbidity. Of the S. aureus bacteraemia and population cohort, 422 (2.11%) and 4048 (2.18%), respectively, developed diabetes without complications, while 245 (1.23%) and 926 (0.50%), respectively, developed diabetes with complications. Rates of diabetes without complication were increased for individuals in the S. aureus bacteraemia cohort compared to the population cohort within the first two years after which rates were comparable while rates of diabetes with complications remained higher throughout the five year follow-up period compared to the population cohort. Conclusions: The risk of diabetes was markedly increased up to five years after S. aureus bacteraemia compared to a population cohort. In addition to screening for diabetes during hospital admittance, screening cases of S. aureus bacteraemia for diabetes in the years following S. aureus bacteraemia may allow for earlier detection of diabetes.