Ibuprofen and other common painkillers are linked to an increased risk of cardiac arrest, according to a new Danish study published in the European Heart Journal—Cardiovascular Pharmacotherapy. The authors say these drugs should be used with caution and that people with heart problems may want to avoid them.

Nonsteroidal anti-inflammatory drugs, or NSAIDs, are among the most commonly used drugs worldwide. Previous studies have linked them to increased risk of heart attack and stroke, heart failure and high blood pressure. Because some of them are sold over the counter, experts worry that people perceive them as safe and free of side effects.

The new study only looked at prescription NSAIDs, but in Denmark, these include ibuprofen and naproxen: two drugs that are available over the counter in the United States under the brand names Advil and Aleve. In Denmark, the only NSAID sold without a prescription is ibuprofen in 200 mg tablets, equal to a regular-strength Advil in the United States.

The researchers reviewed all NSAID prescriptions filled at Danish pharmacies since 1995, as well as the medical records of nearly 30,000 people who had cardiac arrests that occurred between 2001 and 2010.

They found that 3,376 people with cardiac arrest had taken an NSAID in the 30 days before their cardiovascular event. When they compared this to preceding months without heart problems, they found that filling a prescription for any NSAID raised the risk of cardiac arrest by 31%.

When they broke their results down by specific medications, diclofenac—which is also sold by prescription in the United States—was associated with a 50% increased risk, and prescription-strength ibuprofen with a 31% increased risk.

The drugs naproxen, celecoxib and rofecoxib were not associated with cardiac arrest, although the authors say this could be because they are not widely prescribed in Denmark and were underrepresented in the study. (In the United States, celecoxib is sold by prescription; rofecoxib has been withdrawn from the market in both countries.)

The study wasn’t able to tell exactly how long people took the medication, but average treatment lasts from 13-29 days, the study authors note. “Previous studies have observed enhanced cardiovascular risk associated with less than 30 days of treatment with NSAIDs,” they write.

The results emphasize that these drugs are not harmless, said study author Dr. Gunnar Gislason, professor of cardiology at Copenhagen University Hospital, in a press release. “NSAIDs should be used with caution and for a valid indication,” he said. “They should probably be avoided in patients with cardiovascular disease or many cardiovascular risk factors.”

Gislason also said that people should take no more than 500 mg of naproxen or 1,200 mg of ibuprofen per day, and even argued that these drugs should not be sold in supermarkets or convenience stores where there are no pharmacists to advise on proper use.

Dr. Christopher O’Connor, editor-in-chief of the American College of Cardiology journal JACC – Heart Failure, thinks that Gislason’s last suggestion goes too far. He points out that most cases of cardiac arrest in the study were in elderly people with existing risk factors, not people who were otherwise young and healthy.

“I don’t want my 20-year-old son who twists his ankle playing soccer to walk around in pain because he’s scared to take ibuprofen,” says O’Connor. After all, he points out, sharp or chronic pain can constrict blood vessels and affect cardiovascular health, as well.

The study’s results track with what’s already known about NSAIDS: that they can cause sodium retention, make blood thicker and stickier and create a “small but finite risk” for cardiovascular events, O’Connor says.

“I would say the message here is to be careful taking nonsteroidals, particularly high doses, and particularly if you have a preexisting cardiovascular disease,” he says. If you have any doubt about your heart health or your individual risk factors, he adds, talk to your doctor.

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.