Commensal bacteria inhabit mucosal and epidermal surfaces in mice and humans, and have effects on metabolic and immune pathways in their hosts. Recent studies indicate that the commensal microbiota can be manipulated to prevent and even to cure infections that are caused by pathogenic bacteria, particularly pathogens that are broadly resistant to antibiotics, such as vancomycin-resistant Enterococcus faecium, Gram-negative Enterobacteriaceae and Clostridium difficile. In this Review, we discuss how immune- mediated colonization resistance against antibiotic-resistant intestinal pathogens is influenced by the composition of the commensal microbiota. We also review recent advances characterizing the ability of different commensal bacterial families, genera and species to restore colonization resistance to intestinal pathogens in antibiotic-treated hosts.