Background: Rheumatoid arthritis is a chronic inflammatory autoimmune disease that is associated with reduced life expectancy. The disease is heritable and an extensive repertoire of genetic variants have been identified. The gut microbiota might represent an environmental risk factor for rheumatoid arthritis. We aimed to assess whether known rheumatoid arthritis risk alleles were associated with the gut microbiota in a large population who do not have rheumatoid arthritis. Methods: In this cross-sectional study done in the UK and Switzerland, we used genotyping and microbiota data from previous studies of the TwinsUK cohort, excluding participants who had ever had a diagnosis of rheumatoid arthritis, as well as their unaffected co-twins. We used blood samples for genotyping and stool samples for the assessment of the gut microbiota. We generated a polygenic risk score (PRS) for rheumatoid arthritis in 1650 TwinsUK participants without the disease, based on 233 GWAS-identified single nucleotide polymorphisms associated with rheumatoid arthritis. We validated the PRS using logistic regression against rheumatoid arthritis diagnosis in 2686 UK Biobank individuals with a confirmed diagnosis of rheumatoid arthritis. Amplicon sequence variants (ASVs) were generated from 16S rRNA gene sequencing of stool samples and assessed for association with the PRS for rheumatoid arthritis. We validated the findings in an independent sample comprised of first-degree relatives of patients with rheumatoid arthritis from the SCREEN-RA cohort. Differential abundance of ASVs present in more than 5% of samples, grouped by ASV taxon annotation, against the rheumatoid arthritis PRS as a continuous variable was assessed using fixed-effects covariates. To account for multiple testing, the false discovery rate calculation was applied to all p values to generate q values, with a significance threshold of 0·05 determined a priori. Findings: We found that presence of Prevotella spp were positively associated with the rheumatoid arthritis PRS in TwinsUK participants (q<1 × 10−7). This finding was validated in SCREEN-RA participants (n=133) carrying established shared epitope risk alleles (q=0·0011). We also found an association between Prevotella spp and presence of preclinical rheumatoid arthritis phases (q=0·021). Interpretation: Prevotella spp in the gut microbiota are associated with the rheumatoid arthritis genotype in the absence of rheumatoid arthritis, including in individuals at high risk of developing rheumatoid arthritis. Our findings suggest that host genotype is associated with microbiota profile before disease onset. Funding: Versus Arthritis.