Three pharmaceutical companies agreed to a $124 million settlement to resolve claims they failed to pay rebates for some state Medicaid programs, the U.S. Justice Department announced Monday.

Mylan Inc. (MYL) paid a total of $118 million to settle allegations that they underpaid rebates to Medicaid for several of the company's drugs. The company also had to pay an additional $3 million for interest.

AstraZeneca PLC (AZN, AZN.LN) paid $2.6 million to settle charges that it underpaid Medicaid rebates on Albuterol, while Johnson & Johnson (JNJ) subsidiary Ortho-McNeil paid $3.4 million to settle claims that it underpaid Medicaid rebates for Dermatop.

The case originated in a federal court in New Hampshire.

Under the Medicaid Prescription Drug Rebate Program, drug companies pay quarterly rebates to Medicaid programs based on how much money the programs paid for the companies' medicines.

The precise amount of the rebate is determined in part by whether a drug is considered an "innovator" or a "non-innovator." The Justice Department claims the settlement involved allegations the companies classified "innovator" drugs as "non-innovator," which have a smaller rebate.

Mylan said in its statement that the settlement not only resolves the dispute but includes no admission or finding of any wrongdoing. The maker of generic drugs said that it will take a third-quarter charge of $83 million for the deal.

AstraZeneca spokesman Tony Jewell said the company denied any wrongdoing in the matter, "which involved disputed issues regarding the proper classification of a drug under the Medicaid program. The company cooperated fully in the government's investigation and believes this settlement will avoid the burden and expense of litigation."

Mylan's shares were down 0.8% to $16.54 in recent trading, while AstraZeneca's American depositary shares were up 2.6% to $46.13 and Johnson & Johnson rose 1.5% to $61.38 amid a broad market rally.

-By Brent Kendall and John Kell, Dow Jones Newswires; 202-862-9222; brent.kendall@dowjones.com