In complex biological systems, small molecules often mediate microbe-microbe and microbe-host interactions. Using a systematic approach, we identified 3,118 small-molecule biosynthetic gene clusters (BGCs) in genomes of human-associated bacteria and studied their representation in 752 metagenomic samples from the NIH Human Microbiome Project. Remarkably, we discovered that BGCs for a class of antibiotics in clinical trials, thiopeptides, are widely distributed in genomes and metagenomes of the human microbiota. We purified and solved the structure of a thiopeptide antibiotic, lactocillin, from a prominent member of the vaginal microbiota. We demonstrate that lactocillin has potent antibacterial activity against a range of Gram-positive vaginal pathogens, and we show that lactocillin and other thiopeptide BGCs are expressed in vivo by analyzing human metatranscriptomic sequencing data. Our findings illustrate the widespread distribution of small-molecule-encoding BGCs in the human microbiome, and they demonstrate the bacterial production of drug-like molecules in humans.