Although recent studies have revealed the association between the human microbiome especially gut microbiota and longevity, their causality remains unclear. Here, we assess the causal relationships between the human microbiome (gut and oral microbiota) and longevity, by leveraging bidirectional two-sample Mendelian randomization (MR) analyses based on genome-wide association studies (GWAS) summary statistics of the gut and oral microbiome from the 4D-SZ cohort and longevity from the CLHLS cohort. We found that some disease-protected gut microbiota such as Coriobacteriaceae and Oxalobacter as well as the probiotic Lactobacillus amylovorus were related to increased odds of longevity, whereas the other gut microbiota such as colorectal cancer pathogen Fusobacterium nucleatum, Coprococcus, Streptococcus, Lactobacillus, and Neisseria were negatively associated with longevity. The reverse MR analysis further revealed genetically longevous individuals tended to have higher abundances of Prevotella and Paraprevotella but lower abundances of Bacteroides and Fusobacterium species. Few overlaps of gut microbiota-longevity interactions were identified across different populations. We also identified abundant links between the oral microbiome and longevity. The additional analysis suggested that centenarians genetically had a lower gut microbial diversity, but no difference in oral microbiota. Our findings strongly implicate these bacteria to play a role in human longevity and underscore the relocation of commensal microbes among different body sites that would need to be monitored for long and healthy life.