The nation's three largest opioid distributors and two opioid manufacturers are in talks to settle the more than 2,000 lawsuits against them over their role in the opioid epidemic for $50 billion, according to two sources familiar with the talks.

The possible settlement that would include $22 billion in cash and $29 billion in drugs and distribution, according to two people familiar with the talks.

Those involved cautioned that talks are ongoing and the parameters of any deal are fluid.

McKesson, Cardinal Health and Amerisouce Bergen Corp would give $18 billion to be used for treatment and prevention over 18 years. Johnson and Johnson would provide $4 billion.

Teva Pharmaceutical would provide $29 billion worth of drugs as well as money to pay for the cost of distributing those drugs over 10 years. Teva makes buprenorphine, which is a drug used to treat opioid addiction.

The negotiations on the plaintiffs side are being led by four state attorneys general from North Carolina, Pennsylvania, Tennessee and Texas.

The talks between the plaintiffs and the drug companies, first reported by the Wall Street Journal, come on the eve of the first "bellwether" trial against opioid manufacturers, distributors and retail pharmacies, set to start on Monday in Cleveland, Ohio. The pharmaceutical distributors were becoming increasingly concerned as the trial approached, according to people familiar with the negotiations.

Earlier talks in August had yielded a possible deal for $10 billion split between the three companies, but now the potential settlement figure has increased to around $50 billion. Talks are expected to continue this week to reach a deal before Monday's trial begins.

The opioid manufacturer Purdue Pharma was also a target of the lawsuits, but filed for bankruptcy in mid-September. Brought by states, cities, tribes and counties, the lawsuits — almost all of which have been combined into one big case — allege 10 companies were responsible for starting and sustaining the opioid crisis.

McKesson, Cardinal Health and Amerisource Bergen Corporation, which dominate U.S. pharmaceutical distribution, played the role of taking the drugs from the manufacturers and getting them to thousands of pharmacies, hospitals, long term care facilities and other healthcare providers nationwide.

The companies, along with the drug manufacturers, have been blamed by the plaintiff governments for sustaining the opioid epidemic. In particular, the lawsuits claim the distributors did not stop "suspicious orders" of large amounts of opioids even when there were large fluctuations in order size. Instead, the plaintiffs allege, the companies looked the other way.

The opioid epidemic has killed more than 400,000 Americans and cost the United States more than $504 billion, according to a 2017 report by the White House Council of Economic Advisers. The lawsuits, in which plaintiffs seek billions in damages, were consolidated in a federal courtroom in Cleveland, Ohio. The states filed their claims in state courts but are at the negotiating table in an effort to achieve global settlements for all of the claims.

Spokespeople for McKesson and Amerisource Bergen did not respond to a request for comment. Cardinal Health declined to comment, but addressed the lawsuits in a previous statement to NBC News: "Cardinal Health cares deeply about the opioid epidemic and shares the judgment of top policymakers and many others that too many prescriptions have been written for too many opioid pills over the past decade. We take seriously our commitment ... to find and support solutions to this national challenge."

NBC News previously reported that a consultant hired by Cardinal Health told the firm in 2008 it was violating federal guidelines by filling large, potentially "suspicious" orders for drugs and failing to report them to the government. The consultant's report was detailed in an internal corporate document unearthed in the discovery process of one of the lawsuits and viewed by NBC News.

Cardinal and the other drug distributor defendants filed a joint motion to dismiss the suit filed by the state of Ohio, which contains allegations similar to those in suits filed in dozens of other states, all of which are part of the potential settlement agreement. In the motion, the companies' lawyers argue the companies are not liable because the harm caused is "many steps removed from Distributors" and points instead to the "manufacturers that marketed the opioids, the doctors who prescribed (or mis-prescribed) them, the pharmacists who dispensed them and the pharmacy customers who misused or diverted them." The motion was denied.