Alex Wong via Getty Images Sen. Rob Portman (R-Ohio) speaks about the opioid epidemic during a news conference on May 19. Legislators held the event to discuss their support for the Comprehensive Addiction and Recovery Act.

WASHINGTON ― As Congress headed toward its summer recess in late June, the fate of a bill that would dramatically reform the opioid treatment industry was in doubt.

Despite a lopsided 94 to 1 win in the Senate earlier that year, House Republicans had moved at their own pace, having only passed their version in May. Meanwhile, the White House and Senate Democrats were making renewed demands that any policy improvements come with the federal funds to make a real dent.

The White House wanted just over $1 billion, while Senate Democrats were calling for $600 million. The bill’s lead co-sponsor, Sen. Rob Portman (R-Ohio), worried that either amount would have made the bill untenable in the Republican-controlled House.

So he asked for a meeting of Republican leaders to hash out a way forward. Senate Majority Leader Mitch McConnell (R-Ky.) agreed to convene it, hosting the previously unreported gathering in his conference room with Portman and Sens. Kelly Ayotte (R-N.H.), Lamar Alexander (R-Tenn.) and Chuck Grassley (R-Iowa).

Portman laid out the predicament for the Comprehensive Addiction and Recovery Act, arguing that it would likely be fatal for the bill to slip past the recess. It would be nearly impossible to get it taken care of in the short time the Senate came back in September, before breaking again for the election. It was now or never, but there was no way he could get enough Republican votes to attach money to it.

Alexander volunteered a solution. He had been working for months on a massive bill to fund medical research, including Vice President Joe Biden’s moonshot bid to cure cancer. It was a multibillion-dollar package. Why not add $1 billion more to it for opioids?

Portman and the other senators in the room gave a thumbs up, and McConnell told Alexander to try to make it happen.

While Alexander worked, Portman and his Democratic co-sponsor, Sheldon Whitehouse of Rhode Island, pushed forward. The bill cleared the House on July 8 and the Senate on July 13. It was signed into law nine days later.

The Alexander bill, the 21st Century Cures Act, never made it before recess and, as predicted, couldn’t get through in the fall. But it came back to life in the lame duck, breezing through the House last week and cruising through the Senate ― despite a late effort by Sen. Elizabeth Warren (D-Mass.) to derail it for Big Pharma giveaways.

The Cures Act moved forward in the Senate by a vote of 85 to 13 on Monday. Read HuffPost’s reporting on how it all came together here.

The vote itself was an emotional one, with Biden manning the chair and watching as the Senate moved to change a portion of the bill to name it after his late son, Beau Biden.

What may be the most remarkable about the money appropriated by Cures is not what it funds, but what it doesn’t. None of it is directed toward the traditional drug war preoccupations of enforcement or imprisonment. Instead, the money goes toward expanding treatment and prevention, beefing up drug monitoring programs and training for health care providers.

“There’s a widespread bipartisan recognition that we’re not out of the woods on the overdose epidemic ― you look at Massachusetts, Ohio, many other states that are now dealing with illicitly manufactured fentanyl, and things keep getting worse,” explained Daniel Raymond, policy director with the Harm Reduction Coalition.

The question now is whether the White House can get the first half of the money out the door before President-elect Donald Trump takes office. Drug Czar Michael Botticelli is confident he can get it distributed, according to two Democratic senators.

The timing is critical. The bill actually requires that the Health and Human Services secretary makes sure to prioritize funding to the states hit hardest by the epidemic.

“I’m relieved that this bill ensures that funding will be directed to the areas of the country with the most need,” Sen. Jeanne Shaheen (D-N.H.) said in a statement to The Huffington Post. “Those on the frontlines of this epidemic have waited long enough for Congress to take this epidemic seriously.”