Background: Sun exposure causes cutaneous squamous (SCC) and basal cell (BCC) carcinomas. Human papillomavirus (HPV) infection might cause SCC. Methods: We examined associations of b and g HPV infection in skin-swab DNA and serum antibodies with skin cancer risk, and modification of the carcinogenic effects of sun exposure by them, in case–control studies of 385 SCC cases, 832 BCC cases, and 1,100 controls nested in an Australian prospective cohort study (enrolled 2006–2009). Results: Presence of b-1 and b-3 HPV DNA appeared to increase risks for SCC and BCC by 30% to 40% (P adjusted <0.01). BCC was also associated with genus b DNA, OR = 1.48; 95% confidence interval (CI), 1.10 to 2.00 (P adjusted < 0.01). Associations were strengthened with each additional positive b HPV DNA type: SCC (OR = 1.07; 95% CI, 1.02–1.12) and BCC (OR = 1.06; 95% CI, 1.03–1.10), Ptrend < 0.01. Positivity to genus b or g in serology, and genus g in DNA, was not associated with either cancer. There was little evidence that any b HPV type was more strongly associated than others with either cancer. A weaker association of sun exposure with SCC and BCC in the presence of b-3 HPVs than in their absence suggests that b-3 HPVs modify sun exposure’s effect. Conclusions: Our substantive findings are at the level of genus b HPV. Like SCC, BCC risk may increase with increasing numbers of b HPV types on skin. Impact: The consistency in our findings that HPV infection may moderate the effects of sun exposure, the main environmental cause of SCC and BCC, merits further investigation.