In 2004, the acute pain medication Vioxx, made by Merck, was pulled off the market when a study showed that it increased the risk of heart attacks and strokes.

Since then, a cloud of doubt has hung over celecoxib (Celebrex), a similar nonsteroidal anti-inflammatory drug (NSAID) made by Pfizer.

After a decade-long clinical trial, researchers were finally able to weigh in on this issue.

Their conclusion was that Celebrex is at least as safe as ibuprofen and naproxen.

However, the study also found that none of the drugs were completely risk-free.

Read more: New guidelines to prevent opioid addiction »

Comparing three pain drugs

The study included more than 24,000 people with arthritis who either had cardiovascular disease or were at high risk of developing it.

Researchers randomly assigned participants to take one of the three medications at equivalent doses. The study was double-blind, meaning neither the researchers nor the participants knew who received which drug.

Participants took the medication every day for an average of 20 months and were followed for an additional 34 months.

During the trial 188 people taking celecoxib (2.3 percent) died of cardiovascular disease or had a nonfatal heart attack or stroke, compared with 201 people taking naproxen (2.5 percent), and 218 people taking ibuprofen (2.7 percent).

“The authors’ primary conclusion is that there was no difference in the cardiovascular hazard from the three NSAIDs,” Dr. Johanna Contreras, assistant professor of cardiology at the Icahn School of Medicine at Mount Sinai in New York, who was not affiliated with the study, told Healthline.

This surprised even the study’s authors, who thought that celecoxib would be riskier than either naproxen — which many had assumed to be the safest — or ibuprofen.

But, added Contreras, there is “no evidence to suggest that naproxen is safer than the other two drugs.”

The results were published online November 13 in the New England Journal of Medicine and presented at the annual meeting of the American Heart Association.

Read more: Prescription drugs are leading to heroin addictions »

Commonly used drugs

An estimated 2 million people in the United States take Celebrex or the generic version of celecoxib. Both are only available by prescription.

Ibuprofen is also sold over the counter in much lower doses than used in the study, including under the brand name Advil.

Naproxen is sold over the counter as Aleve and Naprosyn.

The authors emphasize that the results only apply to people who already have heart disease or are at high risk of it, and take one of these prescription-dose drugs every day for months or years.

“I don't want the public to think that if you take an occasional ibuprofen or naproxen that you're going to have kidney failure or you're going to die," study author Dr. Steven Nissen of the Cleveland Clinic told NPR. “We didn't study that. We studied daily doses in arthritis patients [taking] ... high doses of these drugs.”

Pfizer paid for the study. To avoid conflicts of interest, members of the study’s executive committee agreed to not take payments from any pharmaceutical company that makes NSAIDs as long as the clinical trial was going on.

Read more: Emergency rooms facing shortage of important drugs »

Surprising secondary outcomes

Researchers also emphasized other noncardiovascular outcomes.

As expected, fewer people taking celecoxib had serious gastrointestinal bleeding and ulcers than those on ibuprofen or naproxen. Celecoxib was intended to minimize these problems.

People taking celecoxib or naproxen were less likely to have kidney problems or be hospitalized for high blood pressure, compared to those taking ibuprofen.

However, some researchers not affiliated with the study interviewed by the The New York Times questioned the importance of these secondary outcomes, since the study was not designed to look at these issues.

One of the biggest limitations was that a small number of patients in the study had documented heart disease.

“The most severe flaw with [the study] is that it was not a study of arthritis patients at high cardiovascular risk,” said Contreras. “It mostly included osteoarthritis patients at low cardiovascular risk.”

More than two-thirds also stopped taking the drug before the end of the study and researchers lost contact with about 30 percent of the participants during the follow-up period.

In addition, “the dose of medication used was limited in order to temper the side effects,” said Contreras. So researchers can’t say what the risks of higher doses would be.

Pfizer will submit a comprehensive report to the FDA. The agency will decide if any of the warnings on the drug’s label — against heart or gastrointestinal effects — should be changed.

For long-term use, prescription doses of celecoxib may be safer for patients compared to ibuprofen or naproxen.

Based on the study, some doctors interviewed by The New York Times would lean toward celecoxib for patients needing to be on a drug long-term.

Others caution that, because of the risks, any of these drugs should be taken in the lowest dose that works and for the least amount of time.

Contreras is less confident in the study’s conclusions.

“Despite the enrollment of more than 24,000 patients and more than a decade of study,” said Contreras, “we are no closer to being able to advise the millions of patients with chronic arthritic pain regarding the relative efficacy and safety of the different NSAID treatments available to them.”