A study published Wednesday in the journal PLOS ONE suggests an unexpected perk of drinking coffee for men: Having two to three cups a day may help prevent erectile dysfunction (ED).  

Researchers from The University of Texas Health Science Center at Houston (UTHealth) found that men who consumed between 85 and 170 milligrams of caffeine a day were 42 percent less likely to report ED, and men who drank between 171 and 303 milligrams of caffeine a day were 39 percent less likely to report ED, compared to those who drank zero to 7 milligrams a day. A cup of coffee has 95 milligrams of caffeine.

Participants answered a single question during a computer-assisted interview, and data was part of the National Health and Nutrition Examiniation Survey, according to a news release. Caffeine sources included coffee, tea, soda and sports drinks.

Study authors believe that caffeine may result in the relaxation of the penile helicine arteries and the cavernous smooth muscle that outlines cavernosal spaces, therefore increasing penile blood flow.

Researchers noted that reduced ED rates held true regardless of whether the men were overweight or obese, or were diagnosed with hypertension, but the trend didn’t hold true for men with diabetes.

“Diabetes is one of the strongest risk factors for ED, so this was not surprising," lead study author David S. Lopez, assistant professor at UTHealth School of Public Health, said in the news release.