Environmental stimuli that signal the occurrence of aversive or dangerous events activate endogenous opiate analgesia systems. Signals for safety (the nonoccurrence of aversive events) produce the opposite and inhibit environmentally produced analgesia. Stimuli that signal safety are now shown to abolish the analgesic effect of morphine, even when morphine is applied directly to spinal cord. Further, this antiopiate effect occurs because the environmental stimulus leads to release of the neuropeptide cholecystokinin in the spinal cord. This process may contribute to the regulation of pain and the development of opiate tolerance.