A strong family history of seizures could increase the chances of having severe migraines, says a study in Epilepsia journal.
Scientists from Columbia University, New York, analysed 500 families containing two or more close relatives with epilepsy.
Their findings could mean that genes exist that cause both epilepsy and migraine.
Epilepsy Action said it could lead to targeted treatments.
Previous studies have shown that people with epilepsy are substantially more likely than the general population to have migraine headaches, but it was not clear whether that was due to a shared genetic cause.
The researchers found that people with three or more close relatives with a seizure disorder were more than twice as likely to experience 'migraine with aura' than patients from families with fewer individuals with seizures.
Migraine with aura is a severe headache preceded by symptoms such as seeing flashing lights, temporary visual loss, speech problems or numbness of the face.
Dr Melodie Winawer, lead author of the study from Columbia University Medical Centre, said the findings had implications for epilepsy patients.
"Our study demonstrates a strong genetic basis for migraine and epilepsy, because the rate of migraine is increased only in people who have close (rather than distant) relatives with epilepsy."
She said further studies of disorders coupled with epilepsy could help "enhance the quality of life for those with epilepsy".
In the study, Dr Winawer and colleagues analysed data collected from the Epilepsy Phenome/Genome Project - a genetic study of epilepsy patients and families from 27 clinical centres in the US, Canada, Argentina, Australia, and New Zealand.
Simon Wigglesworth, deputy chief executive at Epilepsy Action, said the research was encouraging.
"Having a better understanding of the genetic link between epilepsy and other medical conditions can only be a good thing.
"It means that steps can be taken to improve diagnosis and treatment for people living epilepsy and co-existing conditions. By understanding how genes work, more targeted treatments could be developed in the future."
--Courtesy of BBC News