Mental diversions have long been known to make pain easier to handle, and new research suggests that's more than just a psychological phenomenon.

A study in Current Biology claims a distracted mind may actually stop pain from reaching the central nervous system by setting off the release of opioid-based chemicals in the body.

In the study, subjects were asked to complete either a hard or easy memory task while undergoing an fMRI. During the test, a painful level of heat was applied to their arms.

Study participants perceived less pain when they were concentrating on the harder of the two memory tasks -- and what they felt was reflected in the fMRI results.

The researchers at University Medical Center Hamburg-Eppendorf observed that the pain signals were blocked from reaching the spinal cord in the scans of the study subjects performing the more difficult task.

In a follow-up study, the researchers performed the same experiment but gave half of the participants an opioid-blocking drug called naloxone. They found that the pain-relieving effects of distraction dropped by 40 percent among participants who were given the drug.

The finding suggests distraction helps trigger a release of endogenous opioids -- or compounds like endorphins that are naturally produced in the body -- to kill the pain.

"The results demonstrate that this phenomenon is not just a psychological phenomenon, but an active neuronal mechanism reducing the amount of pain signals ascending from the spinal cord to higher-order brain regions," said lead author Christian Sprenger.