Walgreens has entered into an agreement with federal prosecutors in Manhattan to settle Medicaid and Medicare fraud allegations in two separate actions brought against the national pharmacy chain, according to court records unsealed by U.S. District Judge Paul Crotty of the Southern District of New York Tuesday.

The company agreed to pay more than $209 million to resolved that it improperly billed federal health care programs for hundreds of thousands of insulin pens provided to Medicare and Medicaid beneficiaries who did not need the diabetes medication. Additionally, Walgreen’s agreed to a $60 million payment for overbilling Medicaid for medications offered to consumers through a discount program.