Background: In the BRIM-3 trial, vemurafenib was associated with risk reduction versus dacarbazine of both death and progression in patients with advanced BRAFV600 mutation-positive melanoma. We present an extended follow-up analysis of the total population and in the BRAFV600E and BRAFV600K mutation subgroups. Methods: Patients older than 18 years, with treatment-naive metastatic melanoma and whose tumour tissue was positive for BRAFV600 mutations were eligible. Patients also had to have a life expectancy of at least 3 months, an Eastern Cooperative Oncology Group (ECOG) performance status of 0 or 1, and adequate haematological, hepatic, and renal function. Patients were randomly assigned by interactive voice recognition system to receive either vemurafenib (960 mg orally twice daily) or dacarbazine (1000 mg/m2 of body surface area intravenously every 3 weeks). Coprimary endpoints were overall survival and progression-free survival, analysed in the intention-to-treat population (n=675), with data censored at crossover. A sensitivity analysis was done. This trial is registered with ClinicalTrials.gov, NCT01006980. Findings: 675 eligible patients were enrolled from 104 centres in 12 countries between Jan 4, 2010, and Dec 16, 2010. 337 patients were randomly assigned to receive vemurafenib and 338 to receive dacarbazine. Median follow-up was 12·5 months (IQR 7·7-16·0) on vemurafenib and 9·5 months (3·1-14·7) on dacarbazine. 83 (25%) of the 338 patients initially randomly assigned to dacarbazine crossed over from dacarbazine to vemurafenib. Median overall survival was significantly longer in the vemurafenib group than in the dacarbazine group (13·6 months [95% CI 12·0-15·2] vs 9·7 months [7·9-12·8]; hazard ratio [HR] 0·70 [95% CI 0·57-0·87]; p=0·0008), as was median progression-free survival (6·9 months [95% CI 6·1-7·0] vs 1·6 months [1·6-2·1]; HR 0·38 [95% CI 0·32-0·46]; p<0·0001). For the 598 (91%) patients with BRAFV600E disease, median overall survival in the vemurafenib group was 13·3 months (95% CI 11·9-14·9) compared with 10·0 months (8·0-14·0) in the dacarbazine group (HR 0·75 [95% CI 0·60-0·93]; p=0·0085); median progression-free survival was 6·9 months (95% CI 6·2-7·0) and 1·6 months (1·6-2·1), respectively (HR 0·39 [95% CI 0·33-0·47]; p<0·0001). For the 57 (9%) patients with BRAFV600K disease, median overall survival in the vemurafenib group was 14·5 months (95% CI 11·2-not estimable) compared with 7·6 months (6·1-16·6) in the dacarbazine group (HR 0·43 [95% CI 0·21-0·90]; p=0·024); median progression-free survival was 5·9 months (95% CI 4·4-9·0) and 1·7 months (1·4-2·9), respectively (HR 0·30 [95% CI 0·16-0·56]; p<0·0001). The most frequent grade 3-4 events were cutaneous squamous-cell carcinoma (65 [19%] of 337 patients) and keratoacanthomas (34 [10%]), rash (30 [9%]), and abnormal liver function tests (38 [11%]) in the vemurafenib group and neutropenia (26 [9%] of 287 patients) in the dacarbazine group. Eight (2%) patients in the vemurafenib group and seven (2%) in the dacarbazine group had grade 5 events. Interpretation: Inhibition of BRAF with vemurafenib improves survival in patients with the most common BRAFV600E mutation and in patients with the less common BRAFV600K mutation. Funding: F Hoffmann-La Roche-Genentech.