This will be a bitter pill for Johnson & Johnson to swallow.

An Oklahoma judge on Monday ordered the New Jersey-based pharmaceutical giant to pay $572 million in damages for its role in fueling the state’s opioid epidemic.

“The opioid crisis has ravaged the state of Oklahoma. It must be abated immediately,” said Cleveland County District Court Judge Thad Balkman.

The landmark ruling was in response a $17 billion lawsuit alleging the drugmaker helped fuel the opioid epidemic by deceptively peddling painkillers and flooding the market with the deadly drugs.

Out of thousands of lawsuits filed by state and local governments against opioid makers and distributors, this case brought by Oklahoma Attorney General Mike Hunter was the first to go to trial.

The litigation was closely watched by the plaintiffs in over 1,500 similar lawsuits consolidated before a federal judge in Ohio, who has been pushing for a settlement before the October trial.

Oklahoma sued J&J in an effort to help it address the crisis in the state with addiction treatment and prevention programs.

More than 4,000 people died of opioid overdoses in the Sooner State between 2007 and 2017, lawyers said.

During the non-jury trial, Hunter blasted J&J as a “kingpin” company motivated by greed.

He said the corporation’s years-long, aggressive marketing campaign had caused a public nuisance, with doctors over-prescribing the drugs, leading to a surge in overdose deaths.

An ad campaign that overstated how effective the pills were in treating chronic pain and minimized the risk of addiction, the state claimed.

Two of J&J’s subsidiaries, Noramco and Tasmanian Alkaloids, have produced a lot of the raw opium used by other drug manufacturers to make the painkillers, the state said.

“They’ve been the principal origin for the active pharmaceutical ingredient in prescription opioids in the country for the last two decades,” Hunter said.

“It is one of the most important elements of causation with regard to why the defendants … are responsible for the epidemic in the country and in Oklahoma.”

Lawyers for the company maintained that it is part of an industry regulated by the federal government, which answers to the U.S. Drug Enforcement Agency and the Food and Drug Administration, among others, during every step of the supply chain.

Lead attorney Larry Ottaway also claimed painkillers are important in addressing the health needs of Oklahoma residents.

“This problem of untreated chronic pain afflicts people here in Oklahoma,” Ottaway said.

J&J said it would appeal the verdict.

Its shares rose 5 percent in extended trading after the decision.

Opioids were involved in nearly 400,000 OD deaths from 1999 to 2017, according to the US Centers for Disease Control and Prevention.

With Post wires