The pharmaceutical giant Merck & Co. Inc. said on Friday that it had settled Vioxx litigation for $4.85 billion.

Merck signed an agreement on Friday with various parties involved in litigation over the painkiller drug, which was linked to an increased risk for cardiovascular side effects including heart attacks and stroke.

Thousands of Vioxx lawsuits had been filed against Merck, which said the nearly $5 billion would go into a settlement fund for qualifying claims. Eligible victims must be U.S. residents and people whose heart attacks and strokes occurred within the country, Merck added..

Vioxx is in the class of drugs known as cox-2 inhibitors, which are non-steroidal anti-inflammatory drugs used to treat arthritis and other types of pain.