OBJECTIVES: The association between disease activity and infection risk among patients with rheumatoid arthritis (RA) is not clear, and it is challenging to determine because of confounding due to the effects of RA treatments and comorbidities. METHODS: Using RA patients in the CorEvitas registry with Medicare coverage in 2006-2019, we identified eligible patients who had at least one visit with moderate disease activity based on the clinical disease activity index (CDAI>10 and <=22). Follow-up started at the subsequent CorEvitas visit. Hospitalized infection during follow-up was assessed in linked Medicare data. We calculated the incidence rate of hospitalized infection for patients in remission, low, and moderate disease activity and estimated the effect of time-varying CDAI on hospitalized infection by controlling for baseline and time-dependent confounders using marginal structural models (MSM). RESULTS: A total of 3,254 RA patients were eligible for analysis, among which 529 hospitalized infections were identified during follow-up. The crude incidence of hospitalized infection was 3.8 per 100 person years for patients in remission, 6.6 for low disease activity and 8.0 for moderate disease activity. Using MSMs, and compared to being in remission, the hazard ratio of hospitalized infection associated with low disease activity was 1.60 (95% CI: 1.13-2.28) and for moderate disease activity was 1.83 (95% CI: 1.30-2.64). CONCLUSION: The risk of hospitalized infection was higher for RA patients in low or moderate disease activity compared to those in remission after accounting for the interplay of disease activity, RA treatments, treatment switching, and other potential confounders.