WASHINGTON ― Congress is close to passing a bill, after several thwarted attempts, that would include a provision allocating $1 billion to address the opioid epidemic.

But that effort could still be upended by last-minute concerns that the broader legislation is too much of a giveaway to the pharmaceutical and medical device industries.

House and Senate Republicans agreed over the weekend on a final version of the 21st Century Cures Act, one of the last bills on the table before the new Congress is sworn in this January.

Three years in the making, 21st Century Cures is designed as a broad investment in medical research and development at the National Institutes of Health and the U.S. Food and Drug Administration, coupled with the loosening of bureaucratic red tape and regulatory restrictions. Its authors have tinkered with the sources of funding and the language of the legislation. And, in the process, they’ve encouraged lawmakers to offer their support by adding specific, popular provisions to the final product.

One of those provisions was funding to tackle the opioid epidemic, a development that seemed unlikely to transpire as recently as several months ago.

Deaths from opioid overdoses have continued to rise in many communities across the country, and existing treatment systems are outdated and ill-equipped to address the influx, making the need to address the crisis a political imperative. Over the summer, President Barack Obama had signed the Comprehensive Addiction and Recovery Act into law, a bipartisan bill that contained several hopeful developments, such as expanding access to medication-assisted treatments — but included essentially no funding to implement the proposals.

So earlier this month, Sens. Jeanne Shaheen (D-N.H.) and Ed Markey (D-Mass.) began a push to include opioid-related funding in the 21st Century Cures legislation, reminding lawmakers that Congress has yet to help states contain the growing crisis. Last week, they were joined by Sens. Tammy Baldwin (D-Wis.) and Joe Donnelly (D-Ind.) in writing a letter urging Senate Majority Leader Mitch McConnell (R-Ky.) and Minority Leader Harry Reid (D-Nev.) to take action.

“As the end of the year fast approaches, it is past time for Republicans and Democrats to come together to provide emergency funding and increase investments in prevention and treatment services for opioid use, misuse, and use disorders,” the letter read. “Until we do, our job is not done and our communities will continue to hurt.”

But while the opioid funding has helped draw Democrats to support 21st Century Cures, other provisions, including the removal of a mandatory funding stream for medical research investments, have driven some lawmakers away.

Among the bill’s major opponents is Sen. Elizabeth Warren (D-Mass.), who on Monday announced that she will not vote for the bill, despite supporting much of its content, because it has been one of the most heavily lobbied health care bills.

Warren said Senate Republicans “let Big Pharma hijack the Cures bill” and accused them of “trying to buy off Democratic votes one by one by tacking on good bipartisan proposals that senators in both parties have worked on in good faith for years.”

“This final deal has only a tiny fig leaf of funding for NIH and for the opioid crisis,” she said on the Senate floor. “And most of that fig leaf isn’t even real. Most of the money won’t be there, unless future Congresses pass future bills in future years to fund those dollars. So why bother with a fig leaf in the Cures bill? Why pretend to give money to NIH or opioids? Because this funding is political cover for huge giveaways to giant drug companies.”

The House is expected to vote on the 21st Century Cures Act on Wednesday, and the Senate will consider it next week.