State and local governments have filed thousands of lawsuits against the drugmaker over its highly addictive painkillers.

The Israeli drugmaker said Tuesday it reached a tentative deal to pay billions of dollars in cash and Narcan to resolve claims. The Native American tribes would get a lot of money. $650 million was included in previous settlements, according to the company. If the deal is finalized, it will pay out over 13 years.

The company was pleased to have reached a nationwide agreement in principle, pending participation by states and subdivisions, to resolve the majority of our costly legacy opioids litigation, and to make critical medicines available to those most impacted by the US opiate epidemic.

Some of the company's units were accused of marketing Actiq and Fentora to rack up billions of dollars in profits. Billions of dollars are generated by the governments dealing with the public-health crisis tied to the medications.

In the US, more than 3000 state, city, county and tribal governments have filed lawsuits against drugmakers over the damage they've done to their communities. A $26 billion accord covering Johnson & Johnson and the US's three largest drug distributors was part of the consolidated lawsuit.

The deal was a direct result of the years of hard work by community leaders, first responders, and the governments' lawyers who have dedicated their efforts to battling the opiate epidemic across the country for years ahead.

The Allergan unit must reach a similar nationwide deal in order for the settlement to go through. Allergan paid more than 40 billion dollars for its generic drugs business. Prior to the purchase of the generics business, Allergan is required to cover legal costs related to the use of drugs.

The cash and Narcan donation portions of the settlement must be decided by state and local governments. The company, which is dealing with more than $20 billion in debt, had been pushing for a small cash contribution and a large donation of Narcan to be made.

Some settlements have been reached with states that are in Tuesday's accord. In March, the company agreed to give $177 million in cash and $84 million in drugs to Florida. In a deal with Texas, Teva paid $150 million in cash and $75 million worth of drugs.

The company is waiting for a ruling from a New York state judge on how much it will have to give to the two Long Island counties and the city of New York. The company said it is trying to reach a settlement with New York officials.

One of the lawyers in the Long Island case said that the deal shows that high-level litigation is a way to hold companies accountable. The accord will provide critical resources to all states and communities that have been ravaged by the epidemic, according to a lawyer involved in the lawsuit.

There is a consolidated case in Cleveland.

(Updates with comment from governments’ lawyers in sixth paragraph)