The common painkiller Ibuprofen, sold over the counter in supermarkets and pharmacies, doubles the risk of a heart attack in patients who take it at high doses over a long period, a study has found.

The drug is one of the most widely used remedies for headaches, period pains and discomfort caused by inflammation.

It is used by millions of arthritis sufferers on a daily basis to relieve painful joints.

But researchers warned people yesterday not to remove the drug from household medicine cabinets.

There was no danger for occasional users and the benefits of the drug for patients who depend on it to lead normal lives were still likely to outweigh its risks, they said.

The study is the largest and most definitive of its kind into the effect of non-steroidal anti-inflammatory drugs (NSAIDs) on the heart, involving 138 trials covering 140,000 patients.

It follows concern over a separate group of anti-inflammatories - known as the Cox-2 inhibitors - which led to the withdrawal of Vioxx in 2004 after it was linked with an increased rate of heart attacks.

Vioxx , made by Merck, is now the subject of a series of multimillion dollar lawsuits from patients who suffered heart attacks which they claim were caused by the drug.

Now confirmation that drugs such as Ibuprofen, which the Cox-2 inhibitors were designed to replace, also carry an increased risk of heart attack puts the risks of Vioxx in a different light.

The Coxib drugs have fewer side effects on the gut than the NSAIDs such as Ibuprofen, which are prone to cause gastrointestinal bleeding, and some researchers are questioning whether Vioxx should have been withdrawn.

Scientists from the Clinical Trial Service Unit at the University of Oxford, with colleagues from the University of Rome, carried out the study published in the British Medical Journal.

They combined results from all trials of the two classes of drug in order to provide the most reliable estimate of the increased risk.

Two drugs from among the NSAIDs - ibuprofen and the prescription-only diclofenac - increased the risk of a heart attack by almost as much as the Coxib drugs, but a third drug, naproxen, did not.

The researchers say most of the patients in the trials did not have pre-existing heart disease and the increased risk was modest, amounting to three extra heart attacks in every 1,000 people taking Ibuprofen or diclofenac every year.

The two drugs had a lesser effect on the stroke rate.

Overall they increased the risk of any vascular event - heart attack or stroke - by 40 per cent.