In 2014 and 2015, prosecutors said, Actelion raised the price of its main drug, Tracleer, by nearly 30 times the rate of inflation. Tracleer, which is prescribed to treat pulmonary arterial hypertension, sells in pharmacies for an average cash price of about $14,500 for 60 tablets, according to the website GoodRx.

Caroline Pavis, a spokeswoman for Actelion, said in a statement that the company was committed to complying with the law. It admitted no wrongdoing in its settlement. Johnson & Johnson was not implicated in the allegations since the activity under scrutiny took place before Actelion was acquired.

Drug companies often help patients pay their out-of-pocket costs through coupons or other financial assistance. These payments are not just about benevolence — they also help blunt the outrage over rising drug prices by limiting how much patients have to pay. Insurers then cover most of the cost.

But federal anti-kickback laws prohibit companies from giving such financial assistance to Medicare and Medicaid beneficiaries because doing so is considered an inducement to buy their drugs. For years, drug makers have skirted those laws by instead donating to nonprofit charities, which then give the money to Medicare patients. Such arrangements are legal as long as there is no direct coordination between the pharmaceutical company and the nonprofit organization.

Federal prosecutors said Actelion violated the law by collecting detailed data in 2014 and 2015 about the patients receiving help from a nonprofit, the Caring Voice Coalition, and using the data to budget for future donations. As a result, Actelion ensured that the money it donated would be used only to assist patients who used its drugs, and not competing companies’ treatments for the pulmonary condition.