Introduction: Increasing resistance to beta-lactam antibiotics is an alarming development worldwide. Fecal carriership of TEM, SHV, CTX-M and CMY was studied in a community-dwelling population of middle-aged and elderly individuals. Patients and methods: Feces was obtained from individuals of the Rotterdam Study. Carriership of the TEM, SHV, CTX-M and CMY genes was determined using real-time polymerase chain reaction (qPCR). Possible associations were investigated between carriership of these genes and several risk factors, such as the use of antimicrobial drugs, diabetes mellitus, protein pump inhibitor (PPI) use, travelling, the composition of the gut microbiota, and intake of certain foods. Results: The most prevalent gene was TEM (53.0%), followed by SHV (18.4%), CTX-M (5.4%) and CMY (3.6%). Use of penicillins with extended spectrum was associated with TEM carriership, whereas use of macrolides and lincosamides was associated with TEM and SHV carriership. Interestingly, use of PPIs was associated with a higher prevalence of carriership of TEM, SHV and CMY (TEM: odds ratio [OR] 1.34; 95% confidence interval [CI] 1.05–1.77; SHV: OR 2.17; 95%CI 1.55–2.87; CMY: OR 2.26; 95%CI 1.23–4.11). Furthermore, associations were found between the richness and composition of the gut microbiota and TEM and SHV carriership. Conclusions: The prevalence of carriership of TEM was substantial, but the prevalence of carriership of the extended-spectrum β-lactamase gene, CTX-M and the AmpC β-lactamase gene, CMY was relatively low in this community-dwelling, population-based cohort. The composition of the microbiota might play a role in the retention of resistance genes, but future studies are necessary to further elucidate this relationship.