By Robert Preidt

THURSDAY, May 21, 2015 (HealthDay News) -- Coffee perks millions of Americans up each morning, and a new study finds it might help keep men's sex lives percolating, too.

The study, from the University of Texas Health Science Center at Houston, found that men who consume more caffeine each day had a lower risk of erectile dysfunction. The exception? Men with diabetes – for them, extra caffeine didn't lower their odds for impotence, the researchers said.

"Even though we saw a reduction in the prevalence of erectile dysfunction with men who were obese, overweight and hypertensive, that was not true of men with diabetes. Diabetes is one of the strongest risk factors for erectile dysfunction, so this was not surprising," lead author Dr. David Lopez, assistant professor at UTHealth School of Public Health, said in a university news release.

Related: How Much Coffee Is Too Much?

The study couldn't prove cause-and-effect, but one expert said the findings are in line with current research.

"These findings also support the latest U.S. Dietary Guidelines Advisory Committee position that drinking three to five cups a day reduces the risk of type 2 diabetes and heart disease; two conditions that are well established as significant risk factors for erectile dysfunction," said Dr. Natan Bar-Chama, director of Male Reproductive Medicine at the Mount Sinai Hospital in New York City.

In the study, Lopez and colleagues looked at data on more than 3,700 men tracked by the U.S. National Health and Nutrition Examination Survey. The men answered questionnaires asking them to recall their caffeine intake from the prior 24 hours.

The amount of caffeine that appeared to reduce the risk of impotence was equal to two to three cups of coffee a day, the researchers said.

Compared to men in the study who consumed zero to 7 milligrams of caffeine a day, men who consumed 85 to 170 milligrams of caffeine a day were 42 percent less likely to report erectile dysfunction, and those who consumed 171 to 303 milligrams of caffeine a day were 39 percent less likely to report the condition, the Texas team said.

Related: Read This Before You Touch That Office Coffee Mug

Caffeine sources in the study included beverages such as coffee, tea, soda and sports drinks.

The study authors believe that caffeine may help thwart impotence because it relaxes certain arteries and muscles in the penis, improving blood flow and the ability to have an erection.

Another expert agreed. "More research is needed, but what scientists think is happening here is that coffee and caffeine are causing cavernous smooth muscle tissue (found in the penis) to relax, allowing more blood flow to the area and leading to improved erectile function," said Dr. David Samadi, chair of urology at Lenox Hill Hospital in New York City.

The study was published online recently in the journal PLOS One.

According to background information in the study, erectile dysfunction affects more than 18 percent of American men 20 and older.

More information

The American Academy of Family Physicians has more about erectile dysfunction.

SOURCES: Natan Bar-Chama, M.D., associate professor, urology, obstetrics, gynecology and reproductive science, Icahn School of Medicine at Mount Sinai, and director, Male Reproductive Medicine, Mount Sinai Hospital, New York City; David Samadi, M.D., chairman, urology, and chief, robotic surgery, Lenox Hill Hospital, New York City; University of Texas Health Science Center at Houston, news release, May 20, 2015

Last Updated: May 21, 2015

Copyright © 2015 HealthDay. All rights reserved.