The pancreas is a gland located in the retroperitoneum that acts as both an exocrine and endocrine organ. As an exocrine gland, it produces pancreatic juice containing bicarbonate ions and digestive enzymes that are released into the small intestine. The secretion of pancreatic juice is regulated by secretin and cholecystokinin in response to changes in duodenal pH and presence of food. Bicarbonate ions neutralize acid in the duodenum and help activate digestive enzymes. Insulin and other hormones are also produced by the pancreas in its endocrine function.