One in 10 Britons suffer migraines
Studies have indicated a strong link between migraine with aura - the type associated with bright flashing lights - and a hole in the heart.
Scientists found repair of the defect cut the severity of migraine attacks by 37%.
Details of the study, led by doctors in London and Shrewsbury, were presented to the American College of Cardiology.
Around one in ten in the UK suffer from migraines - more than diabetes, asthma and epilepsy combined.
A migraine is a severe headache often accompanied by bright flashing lights in front of the eyes and long periods of sickness.
There is currently no cure for the condition. Some sufferers struggle by with available drug treatments, but for many it seriously affects their ability to live a normal life.
A hole in the heart, known technically as a patent foramen ovale (PFO), is a minor defect in the wall that separates the two upper chambers of the heart, the atria.
In most cases it causes no health problems, but can, in a small minority of people, lead to a stroke.
It is also thought that failure completely to filter the blood of impurities in the normal way may result in migraines.
The link was in part discovered after work on divers, who are more susceptible to decompression sickness - the bends - if they have a PFO.
Several who had the heart problem fixed, also found their migraines got better.
The latest study screened 432 migraine with aura patients, and found 24% had a moderate or large PFO - six times greater than the number found in the general population.
Six months after the procedure to repair the defect, patients reported a 37% reduction in migraine burden - calculated by multiplying the number of headaches by their length.
In patients who underwent a sham procedure the reduction was just 17%.
The researchers had hoped to achieve a 40% reduction - but argue the results are still significant.
Dr Andrew Dowson, of King's College Hospital, London, one of the lead researchers, said: "For the first time we can see trends in a prospective study to suggest that PFO closure may be an effective way to treat certain types of migraine.
"A reduction in headache burden for a patient with severe migraine may allow that individual to gain more control and lead a more fulfilling and productive life.
"The key now will be establishing the criteria that will help to determine which patients should be referred to the interventional cardiologist for further treatment."
Anne Turner, of the Migraine Awareness Association, said: "Migraine is a very individual condition and although we've got lots of effective treatments available, it is very much a matter of trial and error to find the one that works for you.
"This study has opened a whole new avenue which may provide a potential answer for some people."
Zoe Willows, 29, from Reading, took part in the trial.
She used to have five or six severe migraine attacks each month during which she would experience numbness down one side of her body, blurred vision, and an inability to speak as well as an intense headache.
Since the procedure last July to close the hole in her heart Zoe has only had one migraine attack - coming out of the operating theatre immediately after the procedure was completed.
She said: "It has changed my life dramatically. I have got so much more energy."