The government will run out of money after midnight on Thursday night if both chambers do not approve a spending bill.
The legislation also would authorize the energy department to make sales from the nation's strategic petroleum reserve, extend financing for community health care centers for two years and make modifications to medicare, such as repealing a payment cap for therapy services.
Majority Leader Mitch McConnell and Minority Leader Chuck Schumer unveiled a bipartisan budget deal on the Senate floor on Wednesday that would boost military and non-defense spending by $300 billion over the next two years, as well as include a hike in the debt ceiling and more than $80 billion in disaster relief. The bill's funding for the rest of the government would expire next month.
The measure, aides said, also contains nearly $90 billion in overdue disaster aid and an increase in the government borrowing cap that would prevent a first-ever USA government default on its obligations.
Senate Minority Leader Chuck Schumer of NY, speaking on the floor after McConnell, said the agreement was completed "without a great deal of help from the White House".
"We're making real progress on a spending deal that would increase the caps for both military and middle-class priorities on the domestic side that my colleagues have been fighting for", said Senate Democratic Leader Charles Schumer.
"This morning, we took a measure of our Caucus because the package does nothing to advance bipartisan legislation to protect Dreamers in the House", Pelosi said in a statement earlier on Wednesday. The bill now goes to the Senate. He called it "the best thing we've done" for the middle class and the economy.
"My commitment to working together on an immigration measure that we can make law is a honest commitment", Ryan said.
Heritage Action said the deal "is fiscally irresponsible and creates serious long-term budget challenges". The Senate has already promised that vote.
The deal suspends a 2011 budget law championed by conservatives that set hard caps on discretionary spending and included an automatic trigger known as "sequester" cuts if Congress attempted to bust those spending caps. And it would increase the government's borrowing cap to prevent a first-ever default on USA obligations that looms in just a few weeks.
The bill had been cleared by the US Senate in the early hours of Friday, too late to prevent a shutdown.
But the House bill has little chance in the Senate, where a slim Republican majority means Democrat support is needed for any bill to pass.
Aside from the two-year deal, lawmakers were also trying to reach agreement by Thursday to avoid a shutdown and fund the government until March 23.
At issue is the fate of roughly 1.8 million immigrants brought to the country illegally as children.