Venous thromboembolism is a common, potentially avoidable cause of death and morbidity in patients in hospital, including those with stroke. In surgical patients, intermittent pneumatic compression (IPC) reduces the risk of deep vein thrombosis (DVT), but no reliable evidence exists about its effectiveness in patients who have had a stroke. We assessed the effectiveness of IPC to reduce the risk of DVT in patients who have had a stroke. The CLOTS 3 trial is a multicentre parallel group randomised trial assessing IPC in immobile patients (ie, who cannot walk to the toilet without the help of another person) with acute stroke. We enrolled patients from day 0 to day 3 of admission and allocated them via a central randomisation system (ratio 1:1) to receive either IPC or no IPC. A technician who was masked to treatment allocation did a compression duplex ultrasound (CDU) of both legs at 7-10 days and, wherever practical, at 25-30 days after enrolment. Caregivers and patients were not masked to treatment assignment. Patients were followed up for 6 months to determine survival and later symptomatic venous thromboembolism. The primary outcome was a DVT in the proximal veins detected on a screening CDU or any symptomatic DVT in the proximal veins, confirmed on imaging, within 30 days of randomisation. Patients were analysed according to their treatment allocation. ISRCTN93529999. Between Dec 8, 2008, and Sept 6, 2012, 2876 patients were enrolled in 94 centres in the UK. The included patients were broadly representative of immobile stroke patients admitted to hospital and had a median age of 76 years (IQR 67-84). The primary outcome occurred in 122 (8·5%) of 1438 patients allocated IPC and 174 (12·1%) of 1438 patients allocated no IPC; an absolute reduction in risk of 3·6% (95% CI 1·4-5·8). Excluding the 323 patients who died before any primary outcome and 41 without any screening CDU, the adjusted OR for the comparison of 122 of 1267 patients vs 174 of 1245 patients was 0·65 (95% CI 0·51-0·84; p=0·001). Deaths in the treatment period occurred in 156 (11%) patients allocated IPC and 189 (13%) patients allocated no IPC died within the 30 days of treatment period (p=0·057); skin breaks on the legs were reported in 44 (3%) patients allocated IPC and in 20 (1%) patients allocated no IPC (p=0·002); falls with injury were reported in 33 (2%) patients in the IPC group and in 24 (2%) patients in the no-IPC group (p=0·221). IPC is an effective method of reducing the risk of DVT and possibly improving survival in a wide variety of patients who are immobile after stroke. National Institute of Health Research (NIHR) Health Technology Assessment (HTA) programme, UK; Chief Scientist Office of Scottish Government; Covidien (MA, USA).