Melatonin was thought to originate primarily from the pineal gland and to be secreted during the night, but recent studies revealed that gastrointestinal (GI) tract presents another, many times larger, source of melatonin that contributes significantly to the circulating concentration of this indole. Melatonin may exert a direct effect on GI tissues but its major influence on GI organs seems to occur indirectly, via the brain-gut axis including peripheral receptors, sensory afferent (vagal or sympathetic) pathways and central nervous system (CNS) acting on these organs via autonomic efferents and neuromediators. This article reviews and updates our experience with the fascinating molecule, as related to GI organs, with special focus on secretory activity of the stomach and pancreas and the maintenance of their tissue integrity. In addition to being released into the circulation, melatonin is also discharged into the gut lumen and this appears to be implicated in the postprandial stimulation of pancreatic enzyme secretion, mediated by melatonin-induced release of cholecystokinin, acting through entero-gastro-pancreatic reflexes. Although exerting certain differences in the mechanism of action on gastric and pancreatic secretory activities, melatonin derived from its precursor L-tryptophan, exhibits similar highly protective actions against the damage of both the stomach and the pancreas and accelerates the healing of chronic gastric ulcerations by stimulating the microcirculation and cooperating with arachidonate metabolites such as prostaglandins, with nitric oxide released from vascular endothelium, and/or sensory nerves and with their neuropeptides such as calcitonin gene related peptide. The beneficial effects of melatonin results in gastro- and pancreato-protection, prevents various forms of gastritis and pancreatitis through the activation of specific MT2-receptors and scavenges reactive oxygen species (ROS). Melatonin counteracts the increase in the ROS-induced lipid peroxidation and preserves, at least in part, the activity of key anti-oxidizing enzymes such as superoxide dismutase. It is proposed that melatonin should be considered as the agent exerting an important role in prevention of gastric and pancreatic damage and in accelerating healing of gastric ulcers.