Background. There is uncertainty around whether the risks of pelvic inflammatory disease (PID) differ following Chlamydia trachomatis (chlamydia) and Neisseria gonorrhoeae (gonorrhea) infection. We quantified the risk of PID associated with chlamydia and gonorrhea infection and subsequent repeat infections in a whole-population cohort. Methods. A cohort of 315 123 Western Australian women, born during 1974-1995, was probabilistically linked to chlamydia and gonorrhea testing records and to hospitalizations and emergency department presentations for PID from 2002 to 2013. Timeupdated survival analysis was used to investigate the association between chlamydia and gonorrhea testing, and positivity, and risk of PID. Results. Over 3 199 135 person-years, 120 748 women had pathology test records for both chlamydia and gonorrhea, 10 745 chlamydia only, and 653 gonorrhea only. Among those tested, 16 778 (12.8%) had ≥1 positive chlamydia test, 3195 (2.6%) ≥1 positive gonorrhea test, and 1874 (1.6%) were positive for both. There were 4819 PID presentations (2222 hospitalizations, 2597 emergency presentations). Adjusting for age, Aboriginality, year of follow-up, health area, and socioeconomic status, compared to women negative for chlamydia and gonorrhea, the relative risk (adjusted incidence rate ratio) of PID was 4.29 (95% confidence interval [CI], 3.66-5.03) in women who were both chlamydia and gonorrhea positive; 4.54 (95% CI, 3.87-5.33) in those only gonorrhea positive; and 1.77 (95% CI, 1.61-1.94) in those only chlamydia positive. Conclusions. Gonorrhea infection conferred a substantially higher risk than chlamydia of hospitalization or emergency department presentation for PID. The emergence of gonorrhea antimicrobial resistance may have a serious impact on rates of PID and its associated reproductive health sequelae.