Key points• Endoscopists' experience, preprocedure risk assessment, early detection, and appropriate management of the adverse events of ERCP are the keys to minimize the risks.• Acute pancreatitis is the most common serious post-ERCP adverse event. Multiple patient-and procedure-related risk factors are identified. Prophylactic pancreatic stent placement and rectal nonsteroidal anti-inflammatory drugs (NSAIDs) decrease the rate of post-ERCP pancreatitis. The decision on using either or both methods should be individualized based on risk factors and expertise.• Perforation can occur as a result of guidewire penetration, sphincterotomy, luminal trauma, or stent migration. Conservative management is appropriate in most cases but most luminal perforations need surgical and/or endoscopic intervention.• Infection should be suspected when fever occurs following ERCP. Cholangitis when the procedure fails to provide drainage is the most worrisome infection but nosocomial infection, cholecystitis, or pancreatic sepsis can occur. Adequate drainage and antibiotic prophylaxis in high-risk patients decrease the risk.• Bleeding is considered an adverse event when it is evident after termination of ERCP. Coagulopathy is the most common risk factor. Correcting coagulopathy, endoscopic and endovascular examination and/or treatment, and surgery are the mainstay of management.• Cardiopulmonary, sedation-related, and stent-related complications are other adverse events. Rarely, death can occur as a consequence of post-ERCP complications.• The risk of medico-legal action after an adverse event is greatly reduced if the endoscopist and team communicate well and sympathetically with the patient and family before and after the procedure.