**Abstract**

Acute pancreatitis (AP) is an inflammatory disorder of the pancreas, representing one of the most frequent causes of admission to hospital for gastrointestinal diseases in Western countries. Gallstones and alcohol play a fundamental role in the etiology of AP, but several other factors are involved, such as drugs, viruses, trauma, autoimmunity, anatomical anomalies. Chronic pancreatitis (CP) is a chronic inflammatory and fibrotic disease of the pancreas, in the pathogenesis of which both environmental factors, such as alcohol abuse and smoking, and genetic ones (SPINK1, CFTR, PRSS1 mutations) contribute. Endoscopic techniques are commonly used in the management of acute and chronic pancreatitis, allowing in many instances the avoidance of surgical intervention in acutely or chronically ill patients. This advantage is best represented by endoscopic removal of biliary stones in acute gallstone pancreatitis. Furthermore, also peripancreatic collections, such as pseudocyst or walled-off necrosis, can be managed endoscopically, ensuring a minimally invasive drainage. In CP endoscopy has a diagnostic role, especially in the early stages of the disease, but above all therapeutic, in the management of pancreatic duct strictures or stones. Other fields amenable to endoscopic intervention include treatment of potential causes of recurrent AP, such as sphincter of Oddi dysfunction and pancreas divisum.

**Keywords:** ERCP, EUS, walled-off necrosis, pseudocyst, acute pancreatitis, chronic pancreatitis
