It's not clear what might explain the link between erectile dysfunction (ED) and headache, although migraines have been linked to sexual dysfunction in women, the study authors note in the journal Cephalalgia.
But "no study to date has ever attempted to explore the association between migraine and ED," write Dr. Chao-Yuan Huang at National Taiwan University's College of Medicine and his colleagues.
It has been estimated that about 20 million men in the United States suffer from impotence.
The research team collected information on 23,000 men from a national database of insurance claims in Taiwan.
About 5,700 of the men had been diagnosed with erectile dysfunction, which is an inability to get or keep an erection.
Huang's group then compared ED patients to 17,000 similar men who had not sought treatment for impotence.
Among the men with ED, 245, or 4.25 percent, had previously been diagnosed with migraine headaches.
In the group without ED, 457 men, or 2.64 percent, had been diagnosed with migraines.
After the researchers took into account differences between the groups, including heart disease and diabetes, they found that ED patients were 1.63 times as likely to have had a previous migraine diagnosis as men in the other group.
Age seemed to make a difference.
Men in their 30s with erectile dysfunction were about twice as likely as men without it to have a diagnosis of migraines.
The researchers could only speculate as to why migraines are more common among men with erectile dysfunction.
"As it has been demonstrated that chronic pain can cause sexual dysfunction," the authors write, "one possible explanation for the association seen in this study may be the chronic pain associated with migraine headaches."
The authors also offer up the brain chemical dopamine as a potential player, because it is thought to be involved in both migraine headaches and sexual function.
In addition, there's the possibility that the findings could be due to some other factor. For instance, men who see a doctor for migraines might be more likely to seek care for erection problems too, Huang's group notes.
Or it could be that the men diagnosed with migraines are taking medications that interfere with their sexual function.
(For more Life & Style news and updates, follow us on Twitter: @AhramLifestyle)