Background. The influence of HLA class I and II loci on the susceptibility to melanoma remains an area of intense debate. This study aimed to examine whether the HLA system was related to melanoma susceptibility and prognosis in a southern Spanish population. Methods. In this study, HLA class I and class II genotyping were performed using polymerase chain reaction sequence-specific oligonucleotides (PCR-SSO) in 237 Spanish melanoma patients and 636 ethnically matched controls. Data were analyzed according to the clinical characteristics of the defined subgroups. Results. Compared to the control group, DRB1
∗
16:01 (4% vs. 1.3%,
p
=
0.001
, Pc = 0.035, OR = 3.28) and DQB1
∗
05:02 (4.9% vs. 2%,
p
=
0.001
, Pc = 0.017, OR = 2.54) were positivity associated with the susceptibility to melanoma. Both DRB1
∗
16:01 (5.4% vs. 1.3%,
p
=
0.001
, Pc = 0.035, OR = 4.46) and DQB1
∗
05:02 (6.5% vs. 2%,
p
=
0.001
, Pc = 0.017, OR = 3.44) also showed a positive correlation with Breslow thickness >1.5 mm, most notably at an early age of diagnosis (≤58 years), DRB1
∗
16:01 (4.2% vs. 1.3%,
p
=
0.001
, Pc = 0.035, OR = 3.41) and DQB1
∗
05:02 (5.4% vs. 2%,
p
=
0.002
, Pc = 0.034, OR = 2.86). Conclusion. These findings established HLA-DRB1
∗
16:01 and HLA-DQB1
∗
05:02 loci as melanoma risk factors in the southern Spanish population.