Understanding how changes in antibiotic consumption affect the prevalence of antibiotic resistance in bacterial pathogens is important for public health. In a number of bacterial species, including Streptococcus pneumoniae, the prevalence of resistance has remained relatively stable despite prolonged selection pressure from antibiotics. The evolutionary processes allowing the robust coexistence of antibiotic sensitive and resistant strains are not fully understood. While allelic diversity can be maintained at a locus by direct balancing selection, there is no evidence for such selection acting in the case of resistance. In this work, we propose a mechanism for maintaining coexistence at the resistance locus: linkage to a second locus that is under balancing selection and that modulates the fitness effect of resistance. We show that duration of carriage plays such a role, with long duration of carriage increasing the fitness advantage gained from resistance. We therefore predict that resistance will be more common in strains with a long duration of carriage and that mechanisms maintaining diversity in duration of carriage will also maintain diversity in antibiotic resistance. We test these predictions in S. pneumoniae and find that the duration of carriage of a serotype is indeed positively correlated with the prevalence of resistance in that serotype. These findings suggest heterogeneity in duration of carriage is a partial explanation for the coexistence of sensitive and resistant strains and that factors determining bacterial duration of carriage will also affect the prevalence of resistance.A ntibacterial resistance is a serious threat to public health, with resistant strains emerging in numerous pathogens. Although estimates of resistance levels vary by region, pathogen, and antibiotic type, a common feature is that fixation of resistance is rarely observed: sensitive and resistant strains tend to coexist robustly. For example, according to the European Antimicrobial Resistance Surveillance Network (EARS-Net; available at ecdc.europa.eu) (1), the prevalence of penicillin and macrolide nonsensitivity in Streptococcus pneumoniae has been stable at around 10 and 15% respectively for the past 15 years in Europe. Similarly, EARS-Net estimates of multidrug resistance in Klebsiella pneumoniae have varied around 20% since 2009 and those for methicillin resistance in Staphylococcus aureus have ranged between 15 and 25% from 1999 onwards, with no persisting directional trend.The stable coexistence of sensitive and resistant strains is unexpected: because these strains compete for the same hosts, simple ecological models predict that the fitter strain would dominate and the weaker strain become extinct ("competitive exclusion"). Understanding how coexistence is maintained is therefore important for predicting the prevalence of resistant strains and for explaining the approximately linear relationship between regional antibiotic consumption and resistance (2). Predicting the prevalence of resistance is, in turn, crucial...