Abstract Aims The widespread use of immune checkpoint inhibitors (ICIs) has demonstrated significant survival benefits for cancer patients and also carries the risk of immune-related adverse events. ICI-associated myocarditis is a rare and serious adverse event with a high mortality rate. Here, we explored the mechanism underlying ICI-associated myocarditis. Methods and results Using the peripheral blood of patients with ICI therapy and of ICI-treated mice with transplanted tumours, we dissect the immune cell subsets and inflammatory factors associated with myocarditis. Compared to the control group, patients with myocarditis after ICI therapy showed an increase in NK cells and myeloid cells in the peripheral blood, while T cells significantly decreased. Among T cells, there was an imbalance of CD4/CD8 ratio in the peripheral blood of myocarditis patients, with a significant decrease in central memory CD4+ T (CD4+ TCM) cells. RNA sequencing revealed that CD4+ TCM cells in myocarditis patients were immunosuppressive cell subsets, which highly express the immunosuppressive factor IL-4I1. To elucidate the potential mechanism of the decrease in CD4+ TCM cells, protein array was performed and revealed that several inflammatory factors gradually increased with the severity of myocarditis in the myocarditis group, such as IL-1B/CXCL13/CXCL9, while the myocardial protective factor IL-15 decreased. Correlation analysis indicated a positive correlation between IL-15 and CD4+ TCM cells, with high expression of IL-15 receptor IL15RA. Furthermore, in vivo studies using an anti-PDL1 antibody in a mouse tumour model indicated a reduction in CD4+ TCM cells and an increase in effector memory-expressing CD45RA CD8+ T (TEMRA) cells, alongside evidence of cardiac fibrosis. Conversely, combining anti-PDL1 antibody treatment with IL-15 led to a resurgence of CD4+ TCM cells, a reduction in CD8+ TEMRA cells, and a mitigated risk of cardiac fibrosis. Conclusion Our data highlight CD4+ TCM cells’ crucial role in cardiac protection during ICI therapy. IL-15, IL-4I1, and CD4+ TCM cells can serve as therapeutic targets to reduce ICI-associated myocarditis in cancer patients.