Background Myelofibrosis is a chronic myeloproliferative neoplasm characterised by splenomegaly, cytopenias, bone marrow fibrosis, and debilitating symptoms including fatigue, weight loss, and bone pain. Mutations in Janus kinase-2 (JAK2) occur in approximately 50% of patients. The only approved JAK2 inhibitor for myelofibrosis is the dual JAK1 and JAK2 inhibitor, ruxolitinib. 58–71% of patients treated with ruxolitinib in clinical trials so far have not achieved the primary endpoint of 35% or more reduction in spleen volume from baseline assessed by MRI or CT. Furthermore, more than 50% of patients discontinue ruxolitinib treatment after 3–5 years. On the basis of this unmet need, we investigated the efficacy and safety of fedratinib, a JAK2-selective inhibitor, in patients with ruxolitinib-resistant or ruxolitinib-intolerant myelofibrosis. Methods This single-arm, open-label, non-randomised, phase 2, multicentre study, done at 31 sites in nine countries, enrolled adult patients with a current diagnosis of intermediate or high-risk primary myelofibrosis, post-polycythaemia vera myelofibrosis, or post-essential thrombocythaemia myelofibrosis, found to be ruxolitinib resistant or intolerant after at least 14 days of treatment. Other main inclusion criteria were palpable splenomegaly (≥5 cm below the left costal margin), Eastern Cooperative Oncology Group performance status of 2 or less, and life expectancy of 6 months or less. Patients received oral fedratinib at a starting dose of 400 mg once per day, for six consecutive 28-day cycles. The primary endpoint was spleen response (defined as the proportion of patients with a ≥35% reduction in spleen volume as determined by blinded CT and MRI at a central imaging laboratory). We did the primary analysis in the per-protocol population only (patients treated with fedratinib, for whom a baseline and at least one post-baseline spleen volume measurement was available) and the safety analysis in all patients receiving at least one dose of fedratinib. This trial was registered with ClinicalTrials.gov, number NCT01523171. Findings Between May 8, 2012, and Aug 29, 2013, 97 patients were enrolled and received at least one dose of fedratinib. Of 83 assessable patients, 46 (55%, 95% CI 44–66) achieved a spleen response. Common grade 3–4 adverse events included anaemia (37 [38%] of 97 patients) and thrombocytopenia (21 [22%] of 97), with 18 (19%) patients discontinuing due to adverse events. Seven (7%) patients died during the study, but none of the deaths was drug related. Suspected cases of Wernicke's encephalopathy in other fedratinib trials led to study termination. Interpretation This phase 2 study met its primary endpoint, suggesting that patients with ruxolitinib-resistant or ruxolitinib-intolerant myelofibrosis might achieve significant clinical benefit with fedratinib, albeit at the cost of some potential toxicity, which requires further evaluation. Fedratinib development in this setting is currently being assessed. Funding Sanofi.