May 25 (Reuters) - Teva Pharmaceutical Industries and AbbVie's Allergan unit reached a settlement worth $161.5 million to resolve claims the companies fueled an opioid epidemic in West Virginia, state attorney general Patrick Morrisey said on Wednesday.

The agreement is the largest state-negotiated settlement in West Virginia history, and consists of $134 million in cash plus the contribution of drugs used to treat opioid overdoses, Morrisey said at a news conference.

West Virginia had accused Teva and Allergan of deceiving prescribers about the risks of opioids when marketing their drugs for the treatment for chronic pain. The misleading marketing led to an increase in substance abuse and overdose deaths, according to West Virginia's complaint.

The settlement ended a trial that had been proceeding for two months in Kanawha County Circuit Court. The companies did not admit wrongdoing as part of the settlement.

The state's decision to press forward at trial helped it secure more money, Morrisey said.

"We took lot of risk to do the right thing, and it has paid off big for West Virginia," he added.

Teva said it will pay $83 million in cash and provide a 10-year supply of Narcan, a drug used to stop opioid overdoses, which the state valued at $27 million. Allergan said it will pay $51.2 million.

West Virginia has been hit particularly hard by opioid abuse and overdoses, with more than three times the national rate of overdose deaths in 2020, according to the U.S. Centers for Disease Control and Prevention.

West Virginia previously reached a $99 million settlement with Johnson & Johnson and a $26 million settlement with Endo International Plc. Endo settled before the trial began and J&J settled two weeks into the trial.

Israel-based Teva has been attempting to reach a nationwide settlement to resolve opioid lawsuits against the company, and has said it expects a deal by the end of the year.

The West Virginia settlement guarantees the state an additional payout if Teva and Allergan reach larger-than-expected settlements of their nationwide opioid liability, Morrisey said. That agreement would trigger if Teva and Allergan reach a nationwide deal worth more than $7.2 billion, he said.

More than 3,300 lawsuits have been filed against drugmakers, distributors and pharmacies over the U.S. public health crisis. J&J and the three largest U.S. drug distributors - AmerisourceBergen Corp, Cardinal Health Inc and McKesson Corp - previously reached final settlements worth $26 billion over their roles in the nationwide epidemic. (Reporting by Dietrich Knauth; Editing by Louise Heavens, Noeleen Walder and Bill Berkrot)