Background: Dual BRAF and MEK inhibition produces a response in a large number of patients with stage IV BRAF-mutant melanoma. The existing standard of care for patients with clinical stage III melanoma is upfront surgery and consideration for adjuvant therapy, which is insufficient to cure most patients. Neoadjuvant targeted therapy with BRAF and MEK inhibitors (such as dabrafenib and trametinib) might provide clinical benefit in this high-risk p opulation. Methods: We undertook this single-centre, open-label, randomised phase 2 trial at the University of Texas MD Anderson Cancer Center (Houston, TX, USA). Eligible participants were adult patients (aged ≥18 years) with histologically or cytologically confirmed surgically resectable clinical stage III or oligometastatic stage IV BRAFV600E or BRAFV600K (ie, Val600Glu or Val600Lys)-mutated melanoma. Eligible patients had to have an Eastern Cooperative Oncology Group performance status of 0 or 1, a life expectancy of more than 3 years, and no previous exposure to BRAF or MEK inhibitors. Exclusion criteria included metastases to bone, brain, or other sites where complete surgical excision was in doubt. We randomly assigned patients (1:2) to either upfront surgery and consideration for adjuvant therapy (standard of care group) or neoadjuvant plus adjuvant dabrafenib and trametinib (8 weeks of neoadjuvant oral dabrafenib 150 mg twice per day and oral trametinib 2 mg per day followed by surgery, then up to 44 weeks of adjuvant dabrafenib plus trametinib starting 1 week after surgery for a total of 52 weeks of treatment). Randomisation was not masked and was implemented by the clinical trial conduct website maintained by the trial centre. Patients were stratified by disease stage. The primary endpoint was investigator-assessed event-free survival (ie, patients who were alive without disease progression) at 12 months in the intent-to-treat population. This trial is registered at ClinicalTrials.gov, number NCT02231775. Findings: Between Oct 23, 2014, and April 13, 2016, we randomly assigned seven patients to standard of care, and 14 to neoadjuvant plus adjuvant dabrafenib and trametinib. The trial was stopped early after a prespecified interim safety analysis that occurred after a quarter of the participants had been accrued revealed significantly longer event-free survival with neoadjuvant plus adjuvant dabrafenib and trametinib than with standard of care. After a median follow-up of 18·6 months (IQR 14·6–23·1), significantly more patients receiving neoadjuvant plus adjuvant dabrafenib and trametinib were alive without disease progression than those receiving standard of care (ten [71%] of 14 patients vs none of seven in the standard of care group; median event-free survival was 19·7 months [16·2–not estimable] vs 2·9 months [95% CI 1·7–not estimable]; hazard ratio 0·016, 95% CI 0·00012–0·14, p<0·0001). Neoadjuvant plus adjuvant dabrafenib and trametinib were well tolerated with no occurrence of grade 4 adverse events or treatment-related deaths. The most common adverse events in the neoadjuvant plus adjuvant dabrafenib and trametinib group were expected grade 1–2 toxicities including chills (12 patients [92%]), headache (12 [92%]), and pyrexia (ten [77%]). The most common grade 3 adverse event was diarrhoea (two patients [15%]). Interpretation: Neoadjuvant plus adjuvant dabrafenib and trametinib significantly improved event-free survival versus standard of care in patients with high-risk, surgically resectable, clinical stage III–IV melanoma. Although the trial finished early, limiting generalisability of the results, the findings provide proof-of-concept and support the rationale for further investigation of neoadjuvant approaches in this disease. This trial is currently continuing accrual as a single-arm study of neoadjuvant plus adjuvant dabrafenib and trametinib. Funding: Novartis Pharmaceuticals Corporation.