ALBANY — Mylan Inc. will fork over $465 million to settle a joint state-federal lawsuit that claimed the drugmaker overcharged the government for its EpiPen emergency allergy treatment, officials announced Thursday.

Under the settlement terms, New York will receive $38.5 million, state Attorney General Eric Schneiderman said. The settlement allocates money to the Medicaid programs of all 50 states.

The deal ends a lawsuit sparked by skyrocketing charges for EpiPens. Mylan came under harsh criticism after the price of a pair of EpiPens increased about 400 percent since 2010, angering consumers and drawing scrutiny of regulators.

The state-federal lawsuit alleged that from 2010 to 2017 Mylan falsely classified the EpiPen as a generic rather than branded product to reduce the rebates the company pays to the Medicaid health-care program for the poor.

EpiPens are the go-to drug injectors for children and adults suffering from severe allergic reactions and are the most widely prescribed on the market.

“For nearly seven years, Mylan prioritized its bottom line — and shortchanged the Medicaid program and taxpayers,” Schneiderman said in a statement. “By misclassifying EpiPen, Mylan attempted to sidestep [its] obligations, leaving taxpayers to foot the bill.”

advertisement | advertise on newsday

Under the terms, Mylan admitted no wrongdoing. It must reclassify the drug and pay applicable Medicaid rates as of last April 1.

“Bringing closure to this matter is the right course of action for Mylan and our stakeholders to allow us to move forward,” Mylan Chief Executive Heather Bresch said in a statement.