Background: Corneal ulcers are a common cause of blindness in low-income and middle-income countries, usually resulting from traumatic corneal abrasions during agricultural work. Antimicrobial prophylaxis of corneal abrasions can help prevent corneal ulcers, but delays in the initiation of therapy are frequent. We aimed to assess whether a community-based programme for corneal ulcer prevention would reduce the incidence of corneal ulceration. Methods: A cluster-randomised trial was performed in village development committees (VDCs) in Nepal. VDCs in the catchment area of Bharatpur Eye Hospital, Nepal with less than 15 000 people were eligible for inclusion. We randomly assigned (1:1) VDCs to either an intervention group or a control group. In the intervention VDCs, existing female community health volunteers (FCHVs) were trained to diagnose corneal abrasions and provide a 3-day course of ophthalmic antimicrobials to their patients. In the control VDCs, FCHVs did not provide this intervention. Participants were not masked given the nature of the intervention. Both groups were followed up for 3 years for photographic evidence of corneal ulceration. The primary outcome was the incidence of corneal ulceration, determined by masked assessment of corneal photographs. The analysis was by intention to treat. This trial is registered with ClinicalTrials.gov, NCT01969786. Findings: We assessed 112 VDCs, of which 24 were enrolled. The study was performed between Feb 4, 2014, and Oct 20, 2017. 12 VDCs were randomly assigned to the intervention group and 12 to the control group. 252 539 individuals were included in the study (130 579 in the intervention group and 121 960 in the control group). FCHVs diagnosed and provided antimicrobials for 4777 corneal abrasions. The census identified 289 corneal ulcers among 246 893 person-years in the intervention group (incidence 1·21 cases [95% CI 0·85–1·74] per 1000 person-years) and 262 corneal ulcers among 239 170 person-years in the control group (incidence 1·18 cases [0·82–1·70] per 1000 person-years; incidence rate ratio 1·03 [95% CI 0·63–1·67]; p=0·93). Medication allergy was self-reported in 0·2% of participants. Interpretation: We did not detect a reduction in the incidence of corneal ulceration during the first 3 years of a community-based corneal ulcer prevention programme. Further study might be warranted in more rural areas where basic eye care facilities are not available. Funding: National Eye Institute.