Understanding differences in survival across distinct subgroups of melanoma patients may help with the choice of types of therapy. Tumor-infiltrating lymphocytes (TILs) are considered a manifestation of the host immune response to tumor, but the role of TILs in melanoma mortality is controversial. The aim of this study was to investigate independent prognostic factors for melanoma mortality. We carried out a 10-year cohort study on 4133 melanoma patients from the same geographic area (Lazio) with primary cutaneous melanoma diagnosed between January 1998 and December 2008. The probability of survival was estimated using Kaplan–Meier methods and prognostic factors were evaluated by multivariate analysis (Cox proportional hazards model). The 10-year survival rate for melanoma decreased with increasing Breslow thickness (Pfor trend<0.0001) and with age (Pfor trend<0.0001) whereas survival increased with increasing levels of TILs (Pfor trend=0.0001). The 10-year survival rate for melanoma divided into TILs intensity as scanty, moderate, and marked was 88.0, 92.2, and 97.0%, respectively. In the multivariate Cox model, the presence of high levels of TILs in primary invasive melanomas was associated with a lower risk of melanoma death (hazard ratio 0.32; 95% confidence interval 0.13–0.82) after controlling for sex, age, Breslow thickness, histological type, mitotic rate, and ulceration. After including lymph node status in the multivariate analysis, the protective effect of marked TILs on melanoma mortality remained (hazard ratio 0.37; 95% confidence interval 0.15–0.94). The results of this study suggest that the immune microenvironment affects melanoma survival.