This infection rate was higher even in the year before the men got their prescriptions filled, which suggests the risky behavior came first, the researchers reported in the Annals of Internal Medicine.
The study shows that even middle-aged men need advice about spreading and catching STDs, especially AIDS, which is deadly and incurable, Dr. Anupam Jena of Harvard Medical School in Boston and colleagues wrote.
"Users of ED (erectile dysfunction) drugs had higher rates of HIV, chlamydia, gonorrhea and syphilis in the 12 months before filling their first ED drug prescription, although only HIV and chlamydia were statistically significant in this period," Jena's team wrote.
"At a minimum, use of ED drugs seems to correlate with higher-risk sexual behavior, either in the number or type of sexual encounters."
Jena and colleagues looked at the health insurance records of 33,968 men with at least one prescription for an ED drug and more than 1 million men without a prescription, searching billing codes for STDs.
Rates of HIV per 100,000 men in the previous year were 66.5 for men who did not get an ED drug but 147.2 for men who did. Rates of chlamydia where almost triple for men who took an ED drug — 41 per 100,000 compared to 15 per 100,000 for men not using the drugs.
Erectile dysfunction drugs are popular and include Pfizer's Viagra, known generically as sildenafil, vardenafil, sold under the brand name Levitra by GlaxoSmithKline and Eli Lilly and Co's Cialis, known generically as tadalafil.
They all belong to a class called phosphodiesterase-5 inhibitors and they work by increasing blood flow.
As many as 40 percent of men aged 57 to 85 have some degree of erectile dysfunction, editors of the journal wrote in a summary of the findings.
Dr. Thomas Fekete of Temple University School of Medicine in Philadelphia said the study "reminds us that men older than 40 years remain sexually active, even if they need chemical assistance to do so."
"There has been concern that these phosphodiesterase-5 inhibitors have become 'lifestyle' drugs used to intensify sexual pleasure, even in men without ED," Fekete wrote in a commentary.
The study was unable to document why the men got the drugs and also would not account for men who may have bought such drugs over the Internet.
Fekete found something else puzzling. "If the estimated rate of ED in men older than 40 years was 20 percent to 40 percent, it seems surprising that less than 7 percent of these men with insurance coverage received prescriptions for ED drugs," he wrote.
"This implies that despite sexual dysfunction, at least one third of men were either satisfied with their sex lives or obtained ED drugs through other channels (for example, Internet pharmacies)," he added.
The study found that in 2006, 3.6 percent of men over 40 used Viagra, 1.7 percent used Cialis and 1 percent Levitra.