Autoimmune toxicity occurs in up to 60% of patients treated with immune checkpoint inhibitor (ICI) therapy for cancer and represents an increasing clinical challenge for expanding the use of these treatments. To date, human immunopathogenic studies of immune-related adverse events (IRAEs) have relied on sampling of circulating peripheral blood cells rather than affected tissues. Here, we directly obtained thyroid specimens from individuals with ICI-thyroiditis, one of the most common IRAEs, and compared immune infiltrates with those from individuals with spontaneous autoimmune Hashimoto's thyroiditis (HT) or no thyroid disease. Single-cell RNA sequencing revealed a dominant, clonally expanded population of thyroid-infiltrating cytotoxic CXCR6+ CD8+ T cells (effector CD8+ T cells) present in ICI-thyroiditis but not HT or healthy controls. Furthermore, we identified a crucial role for interleukin-21 (IL-21), a cytokine secreted by intrathyroidal T follicular (TFH) and T peripheral helper (TPH) cells, as a driver of these thyrotoxic effector CD8+ T cells. In the presence of IL-21, human CD8+ T cells acquired the activated effector phenotype with up-regulation of the cytotoxic molecules interferon-γ (IFN-γ) and granzyme B, increased expression of the chemokine receptor CXCR6, and thyrotoxic capacity. We validated these findings in vivo using a mouse model of IRAEs and further demonstrated that genetic deletion of IL-21 signaling protected ICI-treated mice from thyroid immune infiltration. Together, these studies reveal mechanisms and candidate therapeutic targets for individuals who develop IRAEs.