Any one of a group of substances that bind to opioid receptors to produce pharmacological and physiological effects similar to those of morphine. Opioids are not necessarily structurally similar to morphine, although a subgroup of opioids, the opiates, are morphine-derived compounds. The endogenous opioids, which occur naturally in the body, comprise the endorphins, enkephalins, and dynorphins.