Executives at the drug company Actavis knew they had to move fast to avoid a plunge in sales of their top-selling drug, Namenda, a treatment for Alzheimer's disease that would lose patent protection in July.

At that point, generic knockoffs would flood the market, and doctors and pharmacists could switch patients to the lower-cost equivalents.

With $1.5 billion in annual sales at stake, Actavis took action. Late last year, it touted a new, extended-release version of the drug, called Namenda XR, which can be taken once a day and carries patent protection until 2029.

Such a move is not unusual, but Actavis took the campaign further by limiting distribution of the original tablet to one mail-order pharmacy, and making doctors submit a note stating the old drug was "medically necessary" for patients.

Those efforts are the focus of a closely watched antitrust lawsuit that pits the drugmaker against New York's attorney general, who says Actavis' strategy was meant to force patients to move to another drug and discourage them from moving to generics. The suit calls the strategy illegal.

Actavis was trying to "squeeze every last dollar out of their Namenda franchise . . . with no concern about the effects . . . on highly vulnerable Alzheimer's patients," Attorney General Eric Schneiderman argued.

Brought by a regulator rather than a rival drug maker, the lawsuit signals growing activism by government "at a time . . . of rising drug costs," wrote lawyer Michael Shuster.

New York won an injunction in December that blocked the firm from limiting access to Namenda, a ruling appealed by the drug maker and now before the U.S. Court of Appeals for the Second Circuit. A decision could come as soon as next month and may help define how far firms can go to shield brand-name profits from generic rivals.

Dublin-based Actavis, which bought Namenda developer Forest Labs last summer, said it has not violated any laws. It described its moves as a commonsense decision to shift customers to what it describes as a better and more convenient product.

Although five drugmakers say they will bring generics to market in July, there are no alternatives to Namenda or Namenda XR, since no other Alzheimer's drug works the same way. The drugs, which have the same active ingredient, slow the progression of symptoms in some patients, but are not a cure.

The other concern is the company's effort to limit sales of its older drug before its patent expired. Patients who switched to the new drug were less likely to have their pharmacists or doctors substitute generics when those became available, critics say.

Jerry Avorn, a professor at Harvard Medical School, said he dislikes the drugmaker's effort to require patients who wanted to stay on the older drug to get a doctor's note citing medical necessity.

"If there's a legitimate concern about a drug, then doing [that] is understandable," he said. "But it's not OK to do it because a company wants to make it harder to get a more affordable drug."

For patients and families, the decision to take Namenda is already complex because it only slows symptoms and doesn't work in many patients, said physician Cheryl Phillips of the advocacy group Leading Age.

For a company to restrict access to such a drug simply to stave off competition after families have chosen to use it "is not an appropriate medical approach," she said.