Tissue-resident memory T (TRM) cells have been widely characterized in infectious disease settings; however, their role in mediating immunity to cancer remains unknown. We report that skin-resident memory T cell responses to melanoma are generated naturally as a result of autoimmune vitiligo. Melanoma antigen–specific TRM cells resided predominantly in melanocyte-depleted hair follicles and were maintained without recirculation or replenishment from the lymphoid compartment. These cells expressed CD103, CD69, and CLA (cutaneous lymphocyte antigen), but lacked PD-1 (programmed cell death protein–1) or LAG-3 (lymphocyte activation gene–3), and were capable of making IFN-γ (interferon-γ). CD103 expression on CD8 T cells was required for the establishment of TRM cells in the skin but was dispensable for vitiligo development. CD103+ CD8 TRM cells were critical for protection against melanoma rechallenge. This work establishes that CD103-dependent TRM cells play a key role in perpetuating antitumor immunity.