The House and Senate approved the measure -- which would fund federal agencies through December 9 -- with just two days before federal agencies were set to run out of money. Obama signed the bill into law Thursday afternoon, before departing for Israel.
Once leaders resolved the final sticking point -- finding a mechanism to approve money for the city of Flint, Michigan, after its water system was contaminated with lead -- members of both parties were eager to wrap up votes and head home to campaign in the final sprint to the November election. Once bipartisan leaders agreed to add an amendment to a separate water infrastructure bill earmarking funds for Flint there was quick agreement to approve the spending bill.
After weeks of negotiation and stalemate, the Senate approved the so-called "continuing resolution" or CR with broad support, passing 72-26.
Senators and House members up for re-election were eager to wrap up business in Washington and return home.
The final package included $1.1 billion for Zika, $500 million for flooding in Louisiana and other states, and $37 million for opioid addiction.
The White House praised the Senate's passage of the bill, though it expressed disappointment that the measure did not include provisions to restore a board quorum to the Export-Import Bank or allow the Securities and Exchange Commission greater authority in regulating public companies' political spending.
"The administration looks forward to working with the Congress to support investments equally balanced between defense and non-defense spending that will create jobs, support middle-class families, contribute to long-term growth, and safeguard national security," the statement said.
Under the outline of the deal, reached Tuesday night by House Minority Leader Nancy Pelosi and Speaker Paul Ryan, the leadership agreed to add aid for Flint on a separate water projects bill, setting up the Wednesday vote on that package. The House approved that water legislation shortly before it voted on the CR. A House-Senate conference committee would later reconcile the two competing bills, setting the stage for final approval of the Flint aid in December.
During the House debate on the water provision, Michigan Democratic Rep. Dan Kildee, who represents the city of Flint and pleaded for months for Congress to help with resources to replace lead pipes and provide health services to sick residents, said "my constituents have been waiting for more than a year for the help they need."
Republican Rep. Bill Huizenga of Michigan, who said his family is originally from Flint, called the situation there "tragic" and said "these folks have experienced failure of government at all levels for decades"
Speaking at the Washington Economic Forum on Wednesday morning, Ryan said he believed moving the Flint aid on the water bill "will help unlock" the funding package, asserting that the Flint issue "now, I think, will be unstuck."
The deadline to fund federal agencies is Friday at midnight. Ryan said Wednesday there won't be a shutdown because GOP members understand the process behind backing a short-term bill.
"Basically, we are having a low-drama moment now," Ryan said.
On the Senate floor Wednesday morning, Minority Leader Harry Reid said the movement in the House is a "step in the right direction." But he had warned Senate Majority Leader Mitch McConnell not to back off commitments to approve money for Flint.
"Why can't they just say they'll do it?" Reid said. "We'll continue to exercise caution moving forward, but I'm glad to see progress has been made."
Reid said on the floor of the Senate he has been given assurances by Republicans that Flint funding will get done in the lame duck session, the period after the elections.
"I am convinced there is going to be help for Flint in the lame duck," he said, adding this should clear the way for government funding to pass probably Wednesday in the Senate and then the House.
Soon after Congress returns for its post-election session it will begin wrangling on the next round of spending bills, with little time again to avert a potential shutdown.