Over-the-counter and prescription drugs that control inflammation, like Advil, Aleve and Motrin, are among the most popular drugs people take. Without a prescription, they can relieve short-term pain from backaches and headaches, and at higher doses can reduce the inflammation behind chronic conditions like osteoarthritis or rheumatoid arthritis. But recent studies have questioned their safety, enough so that in 2015, the Food and Drug Administration (FDA) strengthened warnings on the drugs’ labels about their risk of heart attack and stroke.

But most concerning were the heart risks linked to a new class of these so-called nonsteroidal anti-inflammatory drugs (NSAIDs), the COX-2 inhibitors. These drugs were supposed to be kinder to the stomach and intestines, since NSAIDS typically activated chemicals that compromised the protective lining of these organs, leading to bleeding and pain. It turned out that the benefit for the intestines, however, came at a price to the heart. Two of the COX-2 inhibitors were removed from the market because studies showed they were linked to higher risk of heart attack and stroke.

That left one—celecoxib, or Celebrex—on the market, but the heart concerns led the FDA to require its maker, Pfizer, to pay for additional studies to ensure that celecoxib did not put people at increased risk of heart trouble. Now the results of the study show that contrary to what doctors and regulators expected, celecoxib does not lead to any higher rates of heart events than ibuprofen or naproxen. In fact, celecoxib may even cause fewer kidney problems than the other two NSAIDs.

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.

“I would never have guessed these results,” says the study’s lead author, Dr. Steven Nissen, chair of cardiovascular medicine at the Cleveland Clinic. “The whole world has been saying for a decade now that if you must take an NSAID, you probably ought take naproxen because it’s the safest. We just don’t see that in these results. In almost every measure, ibuprofen looks worse, naproxen is intermediate and celecoxib is the best.”

The study, which is published in the New England Journal of Medicine and which Nissen will present at the American Heart Association annual meeting in New Orleans, involved more than 24,000 people with heart problems who needed to take an NSAID to treat conditions like arthritis and rheumatoid arthritis. They were randomly assigned to take one of the three drugs for nearly two years and followed for another three years for heart attacks, stroke or death. The people assigned to celecoxib did not show any higher rates of these events than those taking ibuprofen or naproxen. When Nissen and his team looked at kidney problems, they found lower risk among those taking celecoxib than among people taking ibuprofen.

“These results negate the preconceived notion—the present thinking—that COX-2 inhibitors are associated with increased heart risk,” says Dr. Nitin Damle, president of the American College of Physicians. “I think people may be more willing to start COX-2 inhibitors a little earlier because they see that heart risk is not increased.”

The previous concerns about COX-2 inhibitors and heart problems led many internists to prescribe NSAIDs like ibuprofen and naproxen as their first-choice therapies for people with osteoarthritis and rheumatoid arthritis, he says. They would only turn to celecoxib if people had stomach issues. Now that may change.

For people who take NSAIDs only occasionally, however, and for short periods of time, the findings shouldn’t make them worry that they’re putting their heart at risk. The study did not include healthy people who didn’t have a history of heart problems, and short-term use is not likely to have the same effect as longer term use typical of patients in chronic pain.

Nissen also notes that nearly 70% of the participants in the study stopped taking their assigned medication; that’s typical in a study of chronic pain in which people get frustrated when their symptoms aren’t relieved and switch from treatment to treatment. But the proportion who stopped their treatment in each group was about the same, meaning that the results were unlikely to have been drastically different if they had continued.

The study also doesn’t address people who take higher doses of any of the drugs; the people were assigned standard doses of 100mg celecoxib twice a day, 600mg ibuprofen three times a day, and naproxen 375mg twice a day.

Whether the findings will now push celecoxib to the front line of treatment for chronic pain conditions isn’t clear yet. Insurance companies cover ibuprofen and naproxen as first line treatments because studies show they are more effective in treating pain symptoms. The current study doesn’t address celecoxib’s efficacy compared to the other drugs, but does show that it’s as safe as they are for the heart.

That means that people who need to take anti inflammatory pain relievers for longer periods of time should consider celecoxib as a viable option, since it doesn’t increase risk of heart problems and may even lower risk of kidney issues. “I think this study really does change the impression we have that COX-2 inhibitors have increased heart risk,” says Damle. “Now it looks like they have similar risk than other non steroidals such as ibuprofen or naproxen.” For those who only take NSAIDs occasionally, the results shouldn’t deter them from seeking relief from the medications.

Contact us at letters@time.com.