Here we show that in a mouse melanoma model, in the tumor-draining lymph nodes (TDLN) rather than in the tumors themselves, stem-like CD8+ T cells differentiate into TRMs in a TGF-β and tumor antigen dependent manner. Here, CD8A is linked to melanoma.