Background Spinal muscular atrophy (SMA) is a progressive motor neuron disease causing loss of motor function and reduced life expectancy, for which limited treatment is available. We investigated the safety and efficacy of olesoxime in patients with type 2 or non-ambulatory type 3 SMA. Methods This randomised, double-blind, placebo-controlled, phase 2 study was done in 22 neuromuscular care centres in Belgium, France, Germany, Italy, Netherlands, Poland, and the UK. Safety and efficacy of olesoxime were assessed in patients aged 3–25 years with genetically confirmed type 2 or non-ambulatory type 3 SMA. A centralised, computerised randomisation process allocated patients (2:1 with stratification by SMA type and centre) to receive olesoxime (10 mg/kg per day) in an oral liquid suspension or placebo for 24 months. Patients, investigators assessing outcomes, and sponsor study personnel were masked to treatment assignment. The primary outcome measure was change from baseline compared with 24 months between the two treatment groups in functional domains 1 and 2 of the Motor Function Measure (MFM D1 + D2) assessed in the full analysis population. A shorter, 20-item version of the MFM, which was specifically adapted for young children, was used to assess patients younger than 6 years. Safety was assessed in the intention-to-treat population. The trial is registered with ClinicalTrials.gov, number NCT01302600. Findings The trial was done between Nov 18, 2010, and Oct 9, 2013. Of 198 patients screened, 165 were randomly assigned to olesoxime (n=108) or placebo (n=57). Five patients in the olesoxime group were not included in the primary outcome analysis because of an absence of post-baseline assessments. The change from baseline to month 24 on the primary outcome measure was 0·18 for olesoxime and −1·82 for placebo (treatment difference 2·00 points, 96% CI −0·25 to 4·25, p=0·0676). Olesoxime seemed to be safe and generally well tolerated, with an adverse event profile similar to placebo. The most frequent adverse events in the olesoxime group were pyrexia (n=34), cough (n=32), nasopharyngitis (n=25), and vomiting (n=25). There were two patient deaths (one in each group), but these were not deemed to be related to the study treatment. Interpretation Olesoxime was safe at the doses studied, for the duration of the trial. Although the primary endpoint was not met, secondary endpoints and sensitivity analyses suggest that olesoxime might maintain motor function in patients with type 2 or type 3 SMA over a period of 24 months. Based on these results, olesoxime might provide meaningful clinical benefits for patients with SMA and, given its mode of action, might be used in combination with other drugs targeting other mechanisms of disease, although additional evidence is needed. Funding AFM Téléthon and Trophos SA.