Agonist and antagonist drugs possessing selectivity for individual types of opioid receptors have been employed in vitro and in vivo to determine the mechanisms by which opioids regulate gastrointestinal functions. Selective mu opioid agonists given by intracerebroventricular (i.c.v.) injection, by intrathecal (i.t.) injection, or by peripheral (s.c. or i.v.) injection in rats or mice decreased gastrointestinal transit and motility, inhibited gastric secretion, and suppressed experimentally-induced diarrhea. Selective delta agonists, by contrast, inhibited gastrointestinal transit after i.t., but not after i.c.v. or s.c. administration. Delta agonists also did not alter gastric secretion after i.c.v. or s.c. injection. However, delta agonists exhibited antidiarrheal effects after i.c.v., i.t., or s.c. administration. Kappa agonists given i.c.v. had no effect on gastrointestinal transit in rats or mice or on gastric secretion in rats, but exhibited antidiarrheal effects in mice. The kappa agonist U-50, 488H given peripherally increased gastric acid secretion. Different types of opioid receptors in different anatomical sites influence differently gastrointestinal motility and propulsion, gastric secretion, and mucosal transport. Brain, spinal cord, enteric neural and smooth muscle opioid receptors represent chemosensitive sites for regulation of gastrointestinal function.