Background: The association between history of keratinocyte carcinoma (KC, also known as nonmelanoma skin cancer) and risk of developing invasive melanoma has not been assessed comprehensively using prospective data. Methods: We followed 91 846 women in the Nurses' Health Study (NHS; 1984-2010, 114 918 women in the NHSII , and 48 946 men in the Health Professionals Follow-up Study (1986-2010 for diagnoses of KC and melanoma biennially. Cox proportional hazards models were used to compute hazard ratios (HRs) and 95% confidence intervals (CIs) of melanoma associated with history of KC, basal cell carcinoma (BCC), and squamous cell carcinoma (SCC). All statistical tests were two-sided. Results: We documented 1949 melanomas, 38 842 BCCs, and 7462 SCCs over 6.4 million person-years of follow-up. After adjustment for other risk factors, a personal history of KC was associated with an increased risk of melanoma (meta-analysis HR ¼ 2.22, 95% CI ¼ 1.73 to 2.85). The association was more apparent among participants with a history of both BCC and SCC (HR ¼ 3.40, 95% CI ¼ 1.60 to 7.19) than among participants with a history of BCC only (HR ¼ 2.20, 95% CI ¼ 1.80 to 2.70) or SCC only (HR ¼ 1.56, 95% CI ¼ 0.98 to 2.46), and there was a strong risk-increasing trend associated with a higher number of reported KCs removed by surgery (P trend < .001). In women, KC history was more strongly associated with head/neck melanomas (HR ¼ 4.17, 95% CI ¼ 2.77 to 6.27) than with trunk or limb melanomas (both HRs < 2.50, P heterogeneity ¼ .04). Conclusions: Our results provide novel insights for the relationship between KC history and risk of developing melanoma, which may be important for melanoma prevention.