Erectile dysfunction (ED), the inability to get and maintain an erection that’s firm enough for sexual intercourse, is a condition that affects around 30 million men, according to the National Institutes of Health. There are medications like Viagra, Cialis and Levitra, as well as others (also known as PDE5i’s) that can help to correct the issue. But a new Swedish study has found that these ED drugs can be risky when taken along with certain heart medications.

Drugs for erectile dysfunction work by widening arteries and increasing blood flow to the penis. Nitrates such as nitroglycerin, which are commonly prescribed to treat the angina chest pain associated with coronary artery disease and to ease the symptoms of heart failure, work in a similar way.

Both types of drugs cause a drop in blood pressure. That’s why taking them together can be dangerous.

Although ED drugs are reasonably safe, using them with an ongoing nitrate prescription is a bad idea since both cause a drop in blood pressure that can trigger a heart attack.

There are already guidelines cautioning against using them in unison. But this recent study shows that this cautionary advice has not been heeded. “Physicians are seeing an increase of requests for erectile dysfunction drugs from men with cardiovascular diseases,” senior researcher Daniel Peter Andersson, an associate professor at the Karolinska Institute in Sweden, said in an American College of Cardiology news release.

The Swedish team analyzed health data on nearly 61,500 men who were prescribed nitrates and had a heart attack or had undergone a procedure to open their blocked arteries. More than 5,700 men among this population were prescribed ED drugs. The data showed that men taking both drugs had an overall higher risk of heart attack, heart failure and other major cardiovascular events — including death.

Although ED drugs are reasonably safe, using them with an ongoing nitrate prescription is ill-advised. “Our goal is to underscore the need for careful patient-centered consideration before prescribing PDE5i medication to men receiving nitrate treatment,” Andersson said. The effects of ED drugs on men with cardiovascular disease have been ambiguous, he added, and suggest the need for more research.

If you’re taking nitrates and also dealing with ED, there are lifestyle changes that may help you manage your condition without taking erectile dysfunction medication. The American Academy of Family Physicians suggests you speak with your doctor about your options. Here are steps they recommend men consider before doubling up on heart and ED medications:

  • Get regular exercise
  • Lose weight if you are obese or overweight
  • Keep your blood sugar under control if you suffer with diabetes
  • Stop smoking
  • Consider surgical procedures or suction devices

The study is published in the Journal of the American College of Cardiology.