Smoking cannabis could provide migraine relief for most people experiencing such symptoms, according to the findings of a new study.

Researchers from the University of New Mexico found that as many as nine out of 10 people with a migraine reported pain relief after smoking cannabis. The study, “Alleviative effects of cannabis flower on migraine and headache,” was published in the Journal of Integrative Medicine last month.

The study is one of the first of its kind to track the real-time effect of marijuana smoke inhalation on a person with a migraine or headache. To investigate this effect, the researchers gathered self-reported data from 699 people who regularly experience migraines or headaches over a 32 month period. With the onset of a migraine or headache, participants were instructed to rate the intensity of the pain on a scale of zero to ten via the smartphone application Releaf. They then smoked cannabis and used the Releaf app to report if doing so had any immediate effect on their experience of migraine pain, according to the ten-point scale.

The collected data included 1910 reports of a headache or migraine with attempts to treat the pain through marijuana consumption. The researchers behind the study discovered that 94 percent of participants reported migraine or headache symptom relief within two hours of smoking cannabis.

“According to the current results, cannabis flower appears to be effective at reducing headache- and migraine-related pain intensity for most people that choose to use it,” the study’s authors wrote.

“It seems possible that the use of cannabis flower, combined with other behavioral modifications, might offer some patients a natural, safer and more effective treatment regimen, compared to the use of some conventional prescription pharmaceuticals,” they added.

The average pain relief on the ten-point scale stood at 3.3 points, though males generally reported more relief than females, while younger participants derived greater benefits from smoking marijuana to treat their migraines than older participants. On the whole, those strains of marijuana containing THC at 10 percent of higher were found to be the most effective at providing migraine relief.

“These results suggest that whole dried cannabis flower may be an effective medication for treatment of migraine- and headache-related pain, but the effectiveness differs according to characteristics of the cannabis plant, the combustion methods, and the age and gender of the patient,” the researchers wrote in their conclusion.

While one of the first studies to track the real-time effect of marijuana consumption on a person experiencing a migraine or headache, previous studies have also found an association between cannabis use and migraine relief. Research presented at this year’s American Headache Society annual meeting indicated marijuana therapy led to a reduction in the use of medications to relieve migraine symptoms.

Another study published earlier this year in the journal Brain Sciences found long-term marijuana smoking was associated with a reduction in the frequency of migraines, while another published last year in the Journal of Pain reported marijuana inhalation reduces migraine pain intensity by up to 50 percent.