Importance: The antifungal medication voriconazole is used to prevent and treat aspergillosis, a major cause of mortality among recipients of lung transplants (hereinafter referred to as lung recipients). Small studies suggest that voriconazole increases risk of cutaneous squamous cell carcinoma (SCC). Objective: To examine associations of voriconazole and other antifungal medications with risk of keratinocyte carcinomas (SCC and cutaneous basal cell carcinoma [BCC]) in lung recipients. Design, Setting, and Participants: This population-based cohort study included non-Hispanic white patients (n = 9599) who underwent lung transplant in the United States from January 1, 2007, to December 31, 2016, identified through the national Scientific Registry of Transplant Recipients with data linkable to pharmacy claims. Data were analyzed from March 1, 2018, to February 13, 2019. Exposures: Antifungal medication use, including voriconazole, itraconazole, posaconazole, and other antifungals, was ascertained from pharmacy claims and treated as a time-varying exposure (assessed every 30 days). Cumulative antifungal exposure was calculated as the total number of exposed months. Main Outcomes and Measures: Primary outcomes were the first SCC or BCC reported to the transplant registry by transplant centers. Follow-up began at transplant and ended at SCC or BCC diagnosis, transplant failure or retransplant, death, loss to follow-up, or December 31, 2016. Cox proportional hazards regression models were used to estimate adjusted hazard ratios (AHRs) for each antifungal medication. Results: Among the 9793 lung transplants in 9599 recipients included in the analysis, median age at transplant was 59 (interquartile range [IQR], 48-65) years, 5824 (59.5%) were male, and 5721 (58.4%) reported ever smoking. During a median follow-up of 3.0 (IQR, 1.4-5.0) years after transplant, 1031 SCCs (incidence, 322 per 10000 person-years) and 347 BCCs (incidence, 101 per 10000 person-years) were reported. Compared with lung recipients with no observed voriconazole use, those with 1 to 3 months of voriconazole use experienced increased AHR for SCC of 1.09 (95% CI, 0.90-1.31); 4 to 7 months, 1.42 (95% CI, 1.16-1.73); 8 to 15 months, 2.04 (95% CI, 1.67-2.50); and more than 15 months, 3.05 (95% CI, 2.37-3.91). Ever itraconazole exposure was associated with increased SCC risk (AHR, 1.20; 95% CI, 1.00-1.45). For BCC, risk was not associated with voriconazole use but was increased with itraconazole use (AHR, 1.74; 95% CI, 1.27-2.37) or posaconazole use (AHR, 1.55; 95% CI, 1.00-2.41). Conclusions and Relevance: In this study, voriconazole use was associated with increased SCC risk among lung recipients, especially after prolonged exposure. Further research evaluating the risk-benefit ratio of shorter courses or alternative medications in transplant recipients at high risk for SCC should be considered..