Background There are no systemic treatments for patients with hepatocellular carcinoma (HCC) whose disease progresses during sorafenib treatment. We aimed to assess the efficacy and safety of regorafenib in patients with HCC who have progressed during sorafenib treatment. Methods In this randomised, double-blind, parallel-group, phase 3 trial done at 152 sites in 21 countries, adults with HCC who tolerated sorafenib (≥400 mg/day for ≥20 of last 28 days of treatment), progressed on sorafenib, and had Child-Pugh A liver function were enrolled. Participants were randomly assigned (2:1) by a computer-generated randomisation list and interactive voice response system and stratified by geographical region, Eastern Cooperative Oncology Group performance status, macrovascular invasion, extrahepatic disease, and α-fetoprotein level to best supportive care plus oral regorafenib 160 mg or placebo once daily during weeks 1–3 of each 4-week cycle. Investigators, patients, and the funder were masked to treatment assignment. The primary endpoint was overall survival (defined as time from randomisation to death due to any cause) and analysed by intention to treat. This trial is registered with ClinicalTrials.gov, number NCT01774344. Findings Between May 14, 2013, and Dec 31, 2015, 843 patients were screened, of whom 573 were enrolled and randomised (379 to regorafenib and 194 to placebo; population for efficacy analyses), and 567 initiated treatment (374 received regorafenib and 193 received placebo; population for safety analyses). Regorafenib improved overall survival with a hazard ratio of 0·63 (95% CI 0·50–0·79; one-sided p<0·0001); median survival was 10·6 months (95% CI 9·1–12·1) for regorafenib versus 7·8 months (6·3–8·8) for placebo. Adverse events were reported in all regorafenib recipients (374 [100%] of 374) and 179 (93%) of 193 placebo recipients. The most common clinically relevant grade 3 or 4 treatment-emergent events were hypertension (57 patients [15%] in the regorafenib group vs nine patients [5%] in the placebo group), hand–foot skin reaction (47 patients [13%] vs one [1%]), fatigue (34 patients [9%] vs nine patients [5%]), and diarrhoea (12 patients [3%] vs no patients). Of the 88 deaths (grade 5 adverse events) reported during the study (50 patients [13%] assigned to regorafenib and 38 [20%] assigned to placebo), seven (2%) were considered by the investigator to be related to study drug in the regorafenib group and two (1%) in the placebo group, including two patients (1%) with hepatic failure in the placebo group. Interpretation Regorafenib is the only systemic treatment shown to provide survival benefit in HCC patients progressing on sorafenib treatment. Future trials should explore combinations of regorafenib with other systemic agents and third-line treatments for patients who fail or who do not tolerate the sequence of sorafenib and regorafenib. Funding Bayer.