A substance that can be either a natural substance released in the body in response to pain or a synthetic compound with effects similar to opium alkaloids.