TRENTON, N.J. — A cheaper version of Johnson & Johnson’s top-selling drug, the pricey rheumatoid arthritis treatment Remicade, could be available in the U.S. two years early after a federal judge ruled that a key patent on the drug is invalid.

J&J, based in New Brunswick, N.J., said Wednesday it plans to appeal a summary judgment issued by the District of Massachusetts federal court in a high-stakes patent fight with rival drugmaker Pfizer Inc.

The appeal process could take a year or more, J&J said.

Pfizer likely will make the somewhat-risky move of launching its competing version, called Inflectra, within a few months.

That could bring patients and insurers savings analysts have estimated at 15 to 30 percent.

Remicade is approved for treating chronic conditions in which the immune system goes haywire and attacks part of the body, including rheumatoid arthritis, ulcerative colitis, psoriasis and Crohn’s disease.

The drug costs roughly $1,600 a month or more without insurance, depending on the condition being treated, the patient’s weight and whether they have just started on Remicade or are on continuing therapy.

Pfizer hasn’t announced a price for Inflectra.

Remicade is an injected biologic drug, “manufactured” in living cells rather than by mixing chemicals. Its just-invalidated patent would have blocked so-called “biosimilars” — nearly identical copies of biologic drugs — until September 2018.

Remicade has been J&J’s biggest revenue generator for several years, pulling in $6.6 billion in 2015, two-thirds of that from U.S. sales.

New York-based Pfizer is seeking a big slice of that pie after having won U.S. Food and Drug Administration approval in early April for Inflectra — only the second biosimilar drug approved in the U.S.

The approval allows sales of Inflectra beginning Oct. 3. It would be made by Pfizer’s Hospira unit, bought last year to boost Pfizer to the top of the nascent field of biosimilars.

Hospira specializes in making biologic medicines and other sterile injectable medicines. While only one biologic has reached the U.S. market, more are on the horizon and several have been on sale for a few years in Europe.

Government health programs there negotiate drug prices and press for cheaper versions.

“We are committed to bringing biosimilars to patients in the U.S. as quickly as possible and are continuing with the preparation of our launch plans for Inflectra for 2016,” Pfizer said in a statement Wednesday. A spokeswoman could not provide a more-specific time frame.

But if J&J wins its planned appeal of the federal court ruling and Remicade’s patent is upheld, Pfizer could be on the hook for paying J&J big financial damages.