The study of the immune response in several types of tumors has been rapidly increasing in recent years with the dual aim of understanding the relationship between neoplastic and immune cells as well as identifying targets for cancer immunotherapy. Despite being considered one of the most immunogenic tumor types, melanoma can progress in the presence of abundant lymphocytic infiltration, therefore suggesting that the immune response is not able to efficiently control tumor growth. The purpose of this study was to investigate whether the density, distribution and grade of tumor-infiltrating lymphocytes (TILs) in 97 canine melanocytic tumors is associated with histologic indicators of malignancy and can be considered a prognostic factor in the dog. As a further step in the characterization of the immune response in melanocytic tumors, an immunohistochemical investigation was performed to evaluate the two main populations of TILs, T-lymphocytes (CD3 +) and B-lymphocytes (CD20 +). The results of our study show that TILs are present in a large proportion of canine melanocytic tumors, especially in oral melanomas, and that, differently from humans, the infiltrate is usually mild. The quantity of CD20 + TILs was significantly associated with some histologic prognostic factors, such as the mitotic count, the cellular pleomorphism and the percentage of pigmented cells. Remarkably, a high infiltration of CD20 + TILs was associated with tumor-related death, presence of metastasis/recurrence, shorter overall and disease-free survival, increased hazard of death and of developing recurrence/metastasis, hence representing a potential new negative prognostic factor in canine melanocytic tumors.