Background: Hydrochlorothiazide, one of the most frequently used diuretic and antihypertensive drugs in the United States and Western Europe, is photosensitizing and has previously been linked to lip cancer. Objective: To examine the association between hydrochlorothiazide use and the risk of basal cell carcinoma (BCC) and squamous cell carcinoma (SCC). Methods: From the Danish Cancer Registry, we identified patients (cases) with nonmelanoma skin cancer (NMSC) during 2004-2012. Controls were matched 1:20 by age and sex. Cumulative hydrochlorothiazide use (in 1995-2012) was assessed from the Danish Prescription Registry. Using conditional logistic regression, we calculated odds ratios (ORs) for BCC and SCC associated with hydrochlorothiazide use. Results: High use of hydrochlorothiazide (≥50,000 mg) was associated with ORs of 1.29 (95% confidence interval [CI], 1.23-1.35) for BCC and 3.98 (95% CI, 3.68-4.31) for SCC. We found clear dose-response relationships between hydrochlorothiazide use and both BCC and SCC; the highest cumulative dose category (≥200,000 mg of HCTZ) had ORs of 1.54 (95% CI, 1.38-1.71) and 7.38 (95% CI, 6.32-8.60) for BCC and SCC, respectively. Use of other diuretics and antihypertensives was not associated with NMSC. Limitations: No data on sun exposure were available. Conclusions: Hydrochlorothiazide use is associated with a substantially increased risk of NMSC, especially SCC.