The aim of the study was to explore the association between mastitis and subsequent breast cancer. This retrospective cohort study included women aged ≥ 18years with an initial mastitis diagnosis from 315 office-based gynecologists in Germany between January 2005 and December 2021. Women without mastitis were matched to women with mastitis using propensity score matching based on age, index year, average yearly consultation frequency during the follow-up period, and coexisting diseases such as obesity, benign mammary dysplasia, hypertrophy of the breast, unspecified lump of breast, and other disorders of the breast. The 10-year cumulative incidence of breast cancer for the mastitis-cohort and non-mastitis-cohort was studied with Kaplan-Meier curves using the log-rank test. The association between mastitis and breast cancer was studied separately for four age groups with univariable Cox regression analyses. In the follow-up period of 7months to 10years after the index date, 2.9% of mastitis patients and 2.4% of matched non-mastitis patients were diagnosed with breast cancer. A Cox regression analysis revealed a significant association between mastitis and subsequent breast cancer (HR: 1.37; 95% CI: 1.11-1.70). According to the age-stratified analyses, a strong and significant association was only observed in the age group > 50years (HR: 1.73; 95% 1.25-2.40). The findings of our retrospective cohort study support an association between mastitis and subsequent breast cancer diagnoses in women aged > 50years. The pathophysiological basis and possibility of confounders however requires further investigation.