Recent clinical trials have shown that pembrolizumab significantly prolonged progression-free survival and overall survival compared with ipilimumab in ipilimumab-naïve patients with unresectable or metastatic melanoma. However, there has been no published evidence on the cost-effectiveness of pembrolizumab for this indication. To assess the long-term cost-effectiveness of pembrolizumab versus ipilimumab in ipilimumab-naïve patients with unresectable or meta-static melanoma from a U.S. integrated health system perspective. A partitioned-survival model was developed, which divided overall survival time into progression-free survival and postprogression survival. The model used Kaplan-Meier estimates of progression-free survival and overall survival from a recent randomized phase 3 study (KEYNOTE-006) that compared pembrolizumab and ipilimumab. Extrapolation of progression-free survival and overall survival beyond the clinical trial was based on parametric functions and literature data. The base-case time horizon was 20 years, and costs and health outcomes were discounted at a rate of 3% per year. Clinical data-including progression-free survival and overall survival data spanning a median follow-up time of 15 months, as well as quality of life and adverse event data from the ongoing KEYNOTE-006 trial-and cost data from public sources were used to populate the model. Costs included those of drug acquisition, treatment administration, adverse event management, and disease management of advanced melanoma. The incremental cost-effectiveness ratio (ICER) expressed as cost difference per quality-adjusted life-year (QALY) gained was the main outcome, and a series of sensitivity analyses were performed to test the robustness of the results. In the base case, pembrolizumab was projected to increase the life expectancy of U.S. patients with advanced melanoma by 1.14 years, corresponding to a gain of 0.79 discounted QALYs over ipilimumab. The model also projected an average increase of $63,680 in discounted perpatient costs of treatment with pembrolizumab versus ipilimumab. The corresponding ICER was $81,091 per QALY ($68,712 per life-year) over a 20-year time horizon. With $100,000 per QALY as the threshold, when input parameters were varied in deterministic one-way sensitivity analyses, the use of pembrolizumab was cost-effective relative to ipilimumab in most ranges. Further, in a comprehensive probabilistic sensitivity analysis, the ICER was cost-effective in 83% of the simulations. Compared with ipilimumab, pembrolizumab had higher expected QALYs and was cost-effective for the treatment of patients with unresectable or metastatic melanoma from a U.S. integrated health system perspective. This study was supported by funding from Merck & Co., which reviewed and approved the manuscript before journal submission. Wang, Pellissier, Xu, Stevinson, and Liu are employees of, and own stock in, Merck & Co. Chmielowski has served as a paid consultant for Merck & Co. and received a consultant fee for clinical input in connection with this study. Chmielowski also reports receiving advisory board and speaker bureau fees from multiple major pharmaceutical companies. Wang led the modeling and writing of the manuscript. Chmielowski, Xu, Stevinson, and Pellissier contributed substantially to the modeling design and methodology. Liu led the data collection work and contributed substantially to writing the manuscript. In conducting the analysis and writing the manuscript, the authors followed Merck publication polices and the "cost-effectiveness analysis alongside clinical trials-good research practices and the CHEERS reporting format as recommended by the International Society for Pharmacoeconomics and Outcomes Research.