Background: Secondary CNS lymphoma is a rare but potentially lethal event in patients with diffuse large B-cell lymphoma. We aimed to assess the activity and safety of an intensive, CNS-directed chemoimmunotherapy consolidated by autologous haematopoietic stem-cell transplantation (HSCT) in patients with secondary CNS lymphoma. Methods: This international, single-arm, phase 2 trial was done in 24 hospitals in Italy, the UK, the Netherlands, and Switzerland. Adults (aged 18–70 years) with histologically diagnosed diffuse large B-cell lymphoma and CNS involvement at the time of primary diagnosis or at relapse and Eastern Cooperative Oncology Group Performance Status of 3 or less were enrolled and received three courses of MATRix (rituximab 375 mg/m2, intravenous infusion, day 0; methotrexate 3·5 g/m2, the first 0·5 g/m2 in 15 min followed by 3 g/m2 in a 3 h intravenous infusion, day 1; cytarabine 2 g/m2 every 12 h, in 1 h intravenous infusions, days 2 and 3; thiotepa 30 mg/m2, 30 min intravenous infusion, day 4) followed by three courses of RICE (rituximab 375 mg/m2, day 1; etoposide 100 mg/m2 per day in 500–1000 mL over a 60 min intravenous infusion, days 1, 2, and 3; ifosfamide 5 g/m2 in 1000 mL in a 24 h intravenous infusion with mesna support, day 2; carboplatin area under the curve of 5 in 500 mL in a 1 h intravenous infusion, day 2) and carmustine–thiotepa and autologous HSCT (carmustine 400 mg/m2 in 500 mL glucose 5% solution in a 1–2 h infusion, day −6; thiotepa 5 mg/kg in saline solution in a 2 h infusion every 12 h, days −5 and −4). The primary endpoint was progression-free survival at 1 year. Overall and complete response rates before autologous HSCT, duration of response, overall survival, and safety were the secondary endpoints. Analyses were in the modified intention-to-treat population. This study is registered with ClinicalTrials.gov, NCT02329080. The trial ended after accrual completion; the database lock was Dec 31, 2019. Findings: Between March 30, 2015, and Aug 3, 2018, 79 patients were enrolled. 75 patients were assessable. 319 (71%) of the 450 planned courses were delivered. At 1 year from enrolment the primary endpoint was met, 42 patients were progression free (progression-free survival 58%; 95% CI 55–61). 49 patients (65%; 95% CI 54–76) had an objective response after MATRix–RICE, 29 (39%) of whom had a complete response. 37 patients who responded had autologous HSCT. At the end of the programme, 46 patients (61%; 95% CI 51–71) had an objective response, with a median duration of objective response of 26 months (IQR 16–37). At a median follow-up of 29 months (IQR 20–40), 35 patients were progression-free and 33 were alive, with a 2-year overall survival of 46% (95% CI 39–53). Grade 3–4 toxicity was most commonly haematological: neutropenia in 46 (61%) of 75 patients, thrombocytopenia in 45 (60%), and anaemia in 26 (35%). 79 serious adverse events were recorded in 42 (56%) patients; four (5%) of those 79 were lethal due to sepsis caused by Gram-negative bacteria (treatment-related mortality 5%; 95% CI 0·07–9·93). Interpretation: MATRix–RICE plus autologous HSCT was active in this population of patients with very poor prognosis, and had an acceptable toxicity profile. Funding: Stand Up To Cancer Campaign for Cancer Research UK, the Swiss Cancer Research foundation, and the Swiss Cancer League.