We carried out metagenomic shotgun sequencing and a metagenome-wide association study (MGWAS) of fecal, dental and salivary samples from a cohort of individuals with rheumatoid arthritis (RA) and healthy controls. Concordance was observed between the gut and oral microbiomes, suggesting overlap in the abundance and function of species at different body sites. Dysbiosis was detected in the gut and oral microbiomes of RA patients, but it was partially resolved after RA treatment. Alterations in the gut, dental or saliva microbiome distinguished individuals with RA from healthy controls, were correlated with clinical measures and could be used to stratify individuals on the basis of their response to therapy. In particular, Haemophilus spp. were depleted in individuals with RA at all three sites and negatively correlated with levels of serum autoantibodies, whereas Lactobacillus salivarius was over-represented in individuals with RA at all three sites and was present in increased amounts in cases of very active RA. Functionally, the redox environment, transport and metabolism of iron, sulfur, zinc and arginine were altered in the microbiota of individuals with RA. Molecular mimicry of human antigens related to RA was also detectable. Our results establish specific alterations in the gut and oral microbiomes in individuals with RA and suggest potential ways of using microbiome composition for prognosis and diagnosis.