Love may hurt emotionally but scientists have found it to heal physical pain after its effects on the brain are similar to those of morphine and cocaine.

Research has shown that positive emotions help enhance ones immune system where as negative emotions can reduce the immune system’s ability to fight infection.

The study carried out by Stanford University researchers on 15 students who were in their first nine months of a love relationship found that they felt less pain while looking at a photo of a loved one.

For the study, students were asked to bring in six photos: three of their beloved and three of a comparably attractive person they knew. The palms of the students’ left hands were heated by the research team to a point that caused either a moderate or high degree of pain while participants looked at a photo, either of their beloved or acquaintance.

The leader of the study, Dr. Sean Mackey, who heads the Division of Pain Management at Stanford University Medical Center, explained that people who are in the midst of a passionate love relationship display “significant alterations in their mood that are impacting their experience of pain.”

Dr. Jarred Younger, study co-researcher also from Stanford, pointed out that the pain relief offered by passionate love “appears to involve more primitive aspects of the brain, activating deep structures that may block pain at a spinal level—similar to how opioid analgesics work.”

Younger concluded that love can relieve pain in the same way that morphine and chocolate does.