There may be a silver lining to the dark cloud of migraines: improved memory.

U.S. researchers have found that women with a history of migraines experience less cognitive decline as they age than those who don't have the debilitating headaches.

Dr. Amanda Kalaydjian of Johns Hopkins Bloomberg School of Public Health, Baltimore and colleagues examined the relationship between migraine headaches and cognitive functioning in 1,448 women. Of those, 204 regularly experienced migraines.

They compared scores on immediate and delayed recall tests and on the Mini-Mental State Examination (MMSE). They performed the tests between 1993 and 1996 and again in 2004 and 2005.

According to the team's report in the current issue of Neurology, those who suffered from migraines scored lower on tests of immediate and delayed memory at the beginning of the study. But their performance declined significantly less over time compared with the non-migraine sufferers.

Migraine sufferers had a 26 per cent and 47 per cent lower word decline on the immediate and delayed recall tests, respectively.

Women over 50 who had migraines showed the least amount of cognitive decline, the researchers noted.

Migraines are a particularly severe form of headache that can last hours or days. They often occur on one side of the head and can involve visual disturbances ("aura"), sensitivity to light, nausea and vomiting.

The cause of migraines remains a mystery, but many sufferers find that avoiding certain foods, such as red wine, as well as ensuring adequate sleep helps to minimize the headaches.

Kalaydjian says it may actually be the lifestyle characteristics of migraine sufferers that explain the findings of her study.

"People with migraines tend to stay away from alcohol, so we might have people that drink less and sleep more, because lack of sleep results in more headaches," she said.

"They might take more vitamins and supplements because they're more health-conscious."

Kalaydjian concluded though that despite that theory "it seems more likely that there is some underlying biological mechanism, such as changes in blood vessels or underlying differences in brain activity, which results in decreased cognitive decline over time."

"One study isn't enough but it lays the groundwork for future studies," Kalaydjian added.

"It brings up the point that maybe this is something that should be looked into, maybe there's a beneficial side effect of having this pain."