A resolution has been reached in a “groundbreaking” antitrust lawsuit that will prevent pharmaceutical companies from impeding access to low-cost, generic Alzheimer’s drugs, the New York State Attorney General announced last week.

The suit stems from attempts by pharmaceutical manufacturer Allergan plc — formerly named Actavis plc — to force Alzheimer’s patients to switch medications a few months prior to the release of a generic version of its drug Namenda IR. By withdrawing Namenda IR from market, and swapping in a similar drug with a longer lasting patent, officials claim Allergan would have forced patients to switch medications, and decrease the likelihood that they’d switch again once the generic was released.

New York State Attorney General Eric Schneiderman sued Allergan in over the “forced switch” in September 2014. In December 2014, a New York judge granted the state an injunction that allowed Namenda IR to stay on the market through August 2015; the U.S. Supreme Court upheld the injunction in May.  The generic version of Nemenda IR became available this past summer.

“Our lawsuit prevented Allergan from pursuing its plan to block competition, thus preserving patient choice for hundreds of thousands of Alzheimer’s patients, and protecting the public from bearing hundreds of millions’ of dollars in unnecessary drug costs,” wrote Schneiderman in a press release.

Allergan announced last week it will pay $172,000 in legal expenses and won’t appeal the Supreme Court’s decision under its settlement with Schneiderman.

Last week, it was announced that pharmaceutical giant Pfizer bought Allergan in a $160 billion deal.