BACKGROUND Erythropoietic protoporphyria is a severe photodermatosis that is associated with acute phototoxicity. Patients with this condition have excruciating pain and a markedly reduced quality of life. We evaluated the safety and efficacy of an α-melanocyte-stimulating hormone analogue, afamelanotide, to decrease pain and improve quality of life. METHODS We conducted two multicenter, randomized, double-blind, placebo-controlled trials of subcutaneous implants containing 16 mg of afamelanotide. Patients in the European Union (74 patients) and the United States (94 patients) were randomly assigned, in a 1:1 ratio, to receive a subcutaneous implant containing either afamelanotide or placebo every 60 days (a total of five implants in the European Union study and three in the U.S study). The type and duration of sun exposure, number and severity of phototoxic reactions, and adverse events were recorded over the respective 180-day and 270-day study periods. Quality of life was assessed with the use of validated questionnaires. A subgroup of U.S. patients underwent photoprovocation testing. The primary efficacy end point was the number of hours of direct exposure to sunlight without pain. RESULTS In the U.S. study, the duration of pain-free time after 6 months was longer in the afamelanotide group (median, 69.4 hours, vs. 40.8 hours in the placebo group; P = 0.04). In the European Union study, the duration of pain-free time after 9 months was also longer in the afamelanotide group than in the placebo group (median, 6.0 hours vs. 0.8 hours; P = 0.005), and the number of phototoxic reactions was lower in the the afamelanotide group (77 vs. 146, P = 0.04). In both trials, quality of life improved with afamelanotide therapy. Adverse events were mostly mild; serious adverse events were not thought to be related to the study drug. CONCLUSIONS Afamelanotide had an acceptable side-effect and adverse-event profile and was associated with an increased duration of sun exposure without pain and improved quality of life in patients with erythropoietic protoporphyria.