Present guidelines are conflicting for patients at high risk of both cardiovascular and gastrointestinal events who continue to require non-steroidal anti-inflammatory drugs (NSAIDs). We hypothesised that a cyclooxygenase-2-selective NSAID plus proton-pump inhibitor is superior to a non-selective NSAID plus proton-pump inhibitor for prevention of recurrent ulcer bleeding in concomitant users of aspirin with previous ulcer bleeding. For this industry-independent, double-blind, double-dummy, randomised trial done in one academic hospital in Hong Kong, we screened patients with arthritis and cardiothrombotic diseases who were presenting with upper gastrointestinal bleeding, were on NSAIDs, and require concomitant aspirin. After ulcer healing, an independent staff member randomly assigned (1:1) patients who were negative for Helicobacter pylori with a computer-generated list of random numbers to receive oral administrations of either celecoxib 100 mg twice per day plus esomeprazole 20 mg once per day or naproxen 500 mg twice per day plus esomeprazole 20 mg once per day for 18 months. All patients resumed aspirin 80 mg once per day. Both patients and investigators were masked to their treatments. The primary endpoint was recurrent upper gastrointestinal bleeding within 18 months. The primary endpoint and secondary safety endpoints were analysed in the modified intention-to-treat population. This study was registered with ClinicalTrials.gov, number NCT00153660. Between May 24, 2005, and Nov 28, 2012, we enrolled 514 patients, assigning 257 patients to each study group, all of whom were included in the intention-to-treat population. Recurrent upper gastrointestinal bleeding occurred in 14 patients in the celecoxib group (nine gastric ulcers and five duodenal ulcers) and 31 patients in the naproxen group (25 gastric ulcers, three duodenal ulcers, one gastric ulcer and duodenal ulcer, and two bleeding erosions). The cumulative incidence of recurrent bleeding in 18 months was 5·6% (95% CI 3·3-9·2) in the celecoxib group and 12·3% (8·8-17·1) in the naproxen group (p=0·008; crude hazard ratio 0·44, 95% CI 0·23-0·82; p=0·010). Excluding patients who reached study endpoints, 21 (8%) patients in the celecoxib group and 17 (7%) patients in the naproxen group had adverse events leading to discontinuation of treatment. No treatment-related deaths occurred during the study. In patients at high risk of both cardiovascular and gastrointestinal events who require concomitant aspirin and NSAID, celecoxib plus proton-pump inhibitor is the preferred treatment to reduce the risk of recurrent upper gastrointestinal bleeding. Naproxen should be avoided despite its perceived cardiovascular safety. The Research Grant Council of Hong Kong.