We conducted a genome-wide association study on the number of melanocytic nevi reported by 9136 individuals of European ancestry, with follow-up replication in 3581 individuals. We identified the nidogen 1 (NID1) gene on 1q42 associated with nevus count (two linked single nucleotide polymorphisms with r(2) > 0.9: rs3768080 A allele associated with reduced count, P = 6.5 × 10(-8); and rs10754833 T allele associated with reduced count, P = 1.5 × 10(-7)). We further determined that the rs10754833 [T] was associated with a decreased melanoma risk in 2368 melanoma cases and 7432 controls [for CT genotype: odds ratio (OR) = 0.86, 95% confidence interval (CI) = 0.75-0.99, P = 0.04; for TT genotype: OR = 0.84, 95% CI = 0.71-0.98, P = 0.03]. Expression level of the NID1 locus was 2-fold higher for the rs10754833 T allele carriers than that with the CC genotype (P = 0.017) in the 87 HapMap CEU cell lines. The NID1 gene is a biologically plausible locus for nevogenesis and melanoma development, with decreased expression levels of NID1 in benign nevi (P = 3.5 × 10(-6)) and in primary melanoma (P = 4.6 × 10(-4)) compared with the normal skin.