Merck & Co. has agreed to pay $12.15 million in plaintiffs’ legal fees to settle two shareholder derivative suits over its painkiller Vioxx — one in state court in New Jersey and the other in the 3rd U.S. Circuit Court of Appeals.

The suits charged the Whitehouse Station, N.J., manufacturer’s current and former directors and officers with breaches of their fiduciary duty in connection with the promotion of Vioxx despite evidence that it caused heart problems.