Despite the usefulness of white light endoscopy (WLE) and non-magnified narrow-band imaging (NBI) for screening for superficial oesophageal squamous cell carcinoma and precancerous lesions, these lesions might be missed due to their subtle features and interpretation variations among endoscopists. Our team has developed an artificial intelligence (AI) system to detect superficial oesophageal squamous cell carcinoma and precancerous lesions using WLE and non-magnified NBI. We aimed to evaluate the auxiliary diagnostic performance of the AI system in a real clinical setting. We did a multicentre, tandem, double-blind, randomised controlled trial at 12 hospitals in China. Eligible patients were aged 18 years or older and underwent sedated upper gastrointestinal endoscopy for screening, investigation of gastrointestinal symptoms, or surveillance. Patients were randomly assigned (1:1) to either the AI-first group or the routine-first group using a computerised random number generator. Patients, pathologists, and statistical analysts were masked to group assignment, whereas endoscopists and research assistants were not. The same endoscopist at each centre did tandem upper gastrointestinal endoscopy for each eligible patient on the same day. In the AI-first group, the endoscopist did the first examination with the assistance of the AI system and the second examination without it. In the routine-first group, the order of examinations was reversed. The primary outcome was the miss rate of superficial oesophageal squamous cell carcinoma and precancerous lesions, calculated on a per-lesion and per-patient basis. All analyses were done on a per-protocol basis. This trial is registered with the Chinese Clinical Trial Registry (ChiCTR2100052116) and is completed. Between Oct 19, 2021, and June 8, 2022, 5934 patients were randomly assigned to the AI-first group and 5912 to the routine-first group, of whom 5865 and 5850 were eligible for analysis. Per-lesion miss rates were 1·7% (2/118; 95% CI 0·0-4·0) in the AI-first group versus 6·7% (6/90; 1·5-11·8) in the routine-first group (risk ratio 0·25, 95% CI 0·06-1·08; p=0·079). Per-patient miss rates were 1·9% (2/106; 0·0-4·5) in AI-first group versus 5·1% (4/79; 0·2-9·9) in the routine-first group (0·37, 0·08-1·71; p=0·40). Bleeding after biopsy of oesophageal lesions was observed in 13 (0·2%) patients in the AI-first group and 11 (0·2%) patients in the routine-first group. No serious adverse events were reported by patients in either group. The observed effect of AI-assisted endoscopy on the per-lesion and per-patient miss rates of superficial oesophageal squamous cell carcinoma and precancerous lesions under WLE and non-magnified NBI was consistent with substantial benefit through to a neutral or small negative effect. The effectiveness and cost-benefit of this AI system in real-world clinical settings remain to be further assessed. National Natural Science Foundation of China, 1·3·5 project for disciplines of excellence, West China Hospital, Sichuan University, and Chengdu Science and Technology Project. For the Chinese translation of the abstract see Supplementary Materials section.