Clinical trials evaluating the protective effect of nonsteroidal anti-inflammatory drugs (NSAIDs) for the prevention of post-endoscopic retrograde cholangiopancreatography pancreatitis (PEP) have yielded inconclusive results. Our objective was to conduct a meta-analysis of the data to date to evaluate the efficacy and safety of rectal NSAIDs for PEP prophylaxis. We did a systematic search of PubMed/MEDLINE, Embase, and Web of Science databases and the Cochrane Central Register of Controlled Trials. The meta-analysis was performed using a fixed-effect method because of the absence of significant heterogeneity in the included trials. Seven randomized, controlled trials involving 2133 patients were included. The meta-analysis showed that rectal NSAIDs decreased the overall incidence of PEP (risk ratio, 0.44; 95% confidence interval, 0.34-0.57; P < 0.01). The number needed to treat was 11. The NSAID prophylaxis also decreased the incidence of moderate to severe PEP (risk ratio, 0.37; 95% confidence interval, 0.27-0.63; P < 0.01). The number needed to treat was 34. No differences of the adverse events attributable to NSAIDs were observed. In conclusion, prophylactic use of rectal NSAIDs reduces the incidence and severity of PEP. There is neither a difference in efficacy between rectal indomethacin and diclofenac nor a difference in efficacy between the timing of administration of rectal NSAIDs, that is, immediate pre-ERCP and post-ERCP.