CONTEXT: Based on limited data, the live attenuated herpes zoster (HZ) vaccine is contraindicated in patients taking anti-tumor necrosis factor (anti-TNF) therapies or other biologics commonly used to treat immune-mediated diseases. The safety and effectiveness of the vaccine are unclear for these patients. OBJECTIVE: To examine the association between HZ vaccination and HZ incidence within and beyond 42 days after vaccination in patients with selected immune-mediated diseases and in relation to biologics and other therapies used to treat these conditions. DESIGN, SETTING, AND PATIENTS: Retrospective cohort study of 463,541 Medicare beneficiaries 60 years and older with rheumatoid arthritis, psoriasis, psoriatic arthritis, ankylosing spondylitis, or inflammatory bowel disease using Medicare claims data from January 1, 2006, through December 31, 2009. MAIN OUTCOME MEASURES: Herpes zoster incidence rate within 42 days after vaccination (a safety concern) and beyond 42 days; hazard ratios estimated using Cox proportional hazards models for HZ comparing vaccinated vs unvaccinated patients. RESULTS: Median duration of follow-up was 2.0 years (interquartile range, 0.8-3.0); 4.0% of patients received HZ vaccine. The overall crude HZ incidence rate was 7.8 cases per 1000 person-years (95% CI, 3.7-16.5) within 42 days after vaccination. The rate among the unvaccinated was 11.6 cases per 1000 person-years (95% CI, 11.4-11.9). Among 633 patients exposed to biologics at the time of vaccination or within the subsequent 42 days, no case of HZ or varicella occurred. After multivariable adjustment, HZ vaccination was associated with a hazard ratio of 0.61 (95% CI, 0.52-0.71) for HZ risk after 42 days. CONCLUSIONS: Receipt of HZ vaccine was not associated with a short-term increase in HZ incidence among Medicare beneficiaries with selected immune-mediated diseases, including those exposed to biologics. The vaccine was associated with a lower HZ incidence over a median of 2 years of follow-up.