Background Epidemiological studies suggest that raised plasma concentrations of total homocysteine might be a risk factor for major vascular events. Whether lowering total homocysteine with B vitamins prevents major vascular events in patients with previous stroke or transient ischaemic attack is unknown. We aimed to assess whether the addition of once-daily supplements of B vitamins to usual medical care would lower total homocysteine and reduce the combined incidence of non-fatal stroke, non-fatal myocardial infarction, and death attributable to vascular causes in patients with recent stroke or transient ischaemic attack of the brain or eye. Methods In this randomised, double-blind, parallel, placebo-controlled trial, we assigned patients with recent stroke or transient ischaemic attack (within the past 7 months) from 123 medical centres in 20 countries to receive one tablet daily of placebo or B vitamins (2 mg folic acid, 25 mg vitamin B6, and 0·5 mg vitamin B12). Patients were randomly allocated by means of a central 24-h telephone service or an interactive website, and allocation was by use of random permuted blocks stratified by hospital. Participants, clinicians, carers, and investigators who assessed outcomes were masked to the assigned intervention. The primary endpoint was the composite of stroke, myocardial infarction, or vascular death. All patients randomly allocated to a group were included in the analysis of the primary endpoint. This trial is registered with ClinicalTrials.gov, NCT00097669, and Current Controlled Trials, ISRCTN74743444. Findings Between Nov 19, 1998, and Dec 31, 2008, 8164 patients were randomly assigned to receive B vitamins (n=4089) or placebo (n=4075). Patients were followed up for a median duration of 3·4 years (IQR 2·0-5·5). 616 (15%) patients assigned to B vitamins and 678 (17%) assigned to placebo reached the primary endpoint (risk ratio [RR] 0·91, 95% CI 0·82 to 1·00, p=0·05; absolute risk reduction 1·56%,-0·01 to 3·16). There were no unexpected serious adverse reactions and no significant differences in common adverse effects between the treatment groups. Interpretation Daily administration of folic acid, vitamin B6, and vitamin B12 to patients with recent stroke or transient ischaemic attack was safe but did not seem to be more effective than placebo in reducing the incidence of major vascular events. These results do not support the use of B vitamins to prevent recurrent stroke. The results of ongoing trials and an individual patient data meta-analysis will add statistical power and precision to present estimates of the effect of B vitamins.