A federal judge has ordered Washington state’s Medicaid provider to cover expensive hepatitis C drugs for all patients with the liver-destroying disease, not just those who are sickest.

U.S. District Court Judge John C. Coughenour granted a preliminary injunction Friday that forces the state Health Care Authority (HCA) to halt a 2015 policy that restricted access to the drugs based on a fibrosis score, a measure of liver scarring.

The injunction was a response to a class-action lawsuit filed in February on behalf of two clients of Apple Health — and nearly 28,000 other Medicaid enrollees with hepatitis C.

The two patients, a 53-year-old Seattle woman and a 47-year-old Lakewood man, were prescribed the drug Harvoni to treat their hepatitis C infections. But they were denied the drug, which costs about $95,000 for a 12-week treatment, because of its cost, the complaint said.

Harvoni is among the newest highly effective drugs that can halt the hepatitis C virus, posting a cure rate of at least 90 percent.

The injunction orders HCA to begin covering Harvoni “without regard to fibrosis score.” The judge ruled that the agency’s policy was not consistent with existing state and federal Medicaid requirements that drugs be dispensed based on medical need.

“For people who have been living with this disease and feeling like there’s no hope if they can’t get this cure, this is life-changing,” said Ele Hamburger, a lawyer with the firm Sirianni, Youtz, Spoonemore and Hamburger, which filed the lawsuit. Co-filers included Columbia Legal Services and the Center for Health Law and Policy Innovation at Harvard Law School.

It’s not clear how soon Medicaid patients with hepatitis C may begin filling prescriptions for Harvoni and other direct-acting antiviral drugs. The ruling orders all parties to report back within 60 days.

HCA officials are reviewing the injunction, a spokeswoman said. But the state Medicaid director, MaryAnne Lindeblad, estimated in a letter to the U.S. Senate last fall that paying for hepatitis C treatment for all Medicaid clients in Washington would be three times the agency’s current $1 billion drug budget.

Medical guidelines had previously supported limiting the drugs to the sickest patients, but that changed last year. Experts in liver treatment and infectious disease now agree that drugs such as Harvoni should be used to treat all patients, including those with mild disease.

Two similar class-action suits in Washington state targeted private insurers Group Health Cooperative and BridgeSpan, a subsidiary of Regence Blue Shield, for rationing the drugs. BridgeSpan changed its policy to provide the drugs to all hepatitis C patients, and Group Health altered its plan to allow consideration of treatment for people with lower levels of liver scarring.

Insurers across the nation have been grappling with when to cover costly drugs to treat hepatitis C. In April, New York Attorney General Eric T. Schneiderman announced that seven insurers had agreed to expand coverage for nearly all commercial health plans in the state.

Judge orders Washington Medicaid to provide lifesaving hepatitis C drugs for all