The importance of the gut microbiome in human health has been widely recognized, with alterations in species abundances now reported for many different diseases. In recent years, observations of within-species genetic diversity and strain-level functional differences have urged the field to transition to analyzing microbes at the genetic level, taking advantage of genetic variants in the metagenome to pinpoint relevant genes and pathways. Here, we conducted a phenome-wide association study (PheWAS) of 12.7 million gut microbial single nucleotide variants (SNVs) with 244 host health phenotypes and environmental exposures in 10,781 individuals from six independent cohorts from Europe and Africa. We found 3,018 associations supported by at least two cohorts for 105 host factors, including age, sex and cardiovascular and metabolic parameters. Moreover, we found 34,927 significant associations in single-cohort analyses where SNV–phenotype pairs were only available for one cohort. All identified associations are detailed in an online catalog (https://fulab.web.rug.nl/SNV-MWAS/). The associated microbial SNVs inform mechanistic hypotheses about microbial functionality in human health and provide insights into microbial adaptation and evolution in response to changes in the environment and host physiology. For example, we identified 718 age-associated gut microbial SNVs across multiple cohorts and used these microbial SNVs to accurately predict host age. We also identified SNVs in microbial genes associated with lipid concentrations and BMI, including SNVs in the isoleucine-tRNA synthetase gene of Clostridium phoceensis and an α-Melanocyte-stimulating hormone-mimicking clpB gene of Alistipes ihumii. Mediation analysis provided evidence that microbial genetic variations may be under selection enforced by environmental factors, but also that they mediate the effects on the host, e.g. the isoleucyl-tRNA synthetase gene of C. phoceensis mediated dietary effects on four phenotypes. Overall, this study identifies new biological connections between human host and microbial genetic variants, exposing the functional layer of gut microbiome data hidden at base pair resolution and revealing microbial adaptation and evolution in relation to host lifestyle and physiology.