Objective: The optimal timing of tumor necrosis factor antagonists before elective surgery is unknown. This study evaluated the association between infliximab timing and serious infection after elective hip or knee arthroplasty. Methods: A retrospective cohort study evaluated US Medicare patients with rheumatoid arthritis, inflammatory bowel disease, psoriasis, psoriatic arthritis, or ankylosing spondylitis who received infliximab within 6 months of elective knee or hip arthroplasty from 2007 to 2013. Propensity-adjusted analyses examined whether infliximab stop timing (time between the most recent infusion and surgery) was associated with hospitalized infection within 30 days or prosthetic joint infection (PJI) within 1 year. Results: Hospitalized infection within 30 days occurred after 270 of 4,288 surgeries (6.3%). Infliximab stop timing <4 weeks versus 8–12 weeks was not associated with an increase in infection within 30 days (propensity-adjusted odds ratio [OR] 0.90 [95% confidence interval (95% CI) 0.60–1.34]). The rate of PJI was 2.9 per 100 person-years and was not increased in patients with stop timing <4 weeks versus 8–12 weeks (hazard ratio [HR] 0.98 [95% CI 0.52–1.87]). Glucocorticoid dosage >10 mg/day was associated with increased risk of 30-day infection (OR 2.11 [95% CI 1.30–3.40]) and PJI (HR 2.70 [95% CI 1.30–5.60]). Other risk factors for infection included elderly age, comorbidities, revision surgery, and previous hospitalized infection. Conclusion: Administering infliximab within 4 weeks of elective knee or hip arthroplasty was not associated with a higher risk of short- or long-term serious infection compared to withholding infliximab for longer time periods. Glucocorticoid use, especially >10 mg/day, was associated with an increased infection risk.