After passing through the House just after 5:30 a.m. Friday morning, President Donald Trump signed it, marking the end of the second government shutdown in the last month.
Obama-era guarantees for those immigrants were cancelled by US President Donald Trump and are set to become invalid next month.
In a statement, U.S. Representative Katherine Clark of Melrose applauded the bill's spending measures, including funding for community health centers, but indicated she voted against it because Ryan "refuses to bring any immigration legislation forward even though there are bipartisan immigration bills drafted and waiting".
In the Senate, one Republican lawmaker - Rand Paul of Kentucky - delayed the final vote until after a midnight deadline when funding for the government ran out and a partial shutdown took effect.
Trump echoed those concerns but said that in order to secure Democratic votes for the package, more spending "on things we do not like or want" was necessary. "You know, we could have moved forward with a responsible spending package that had amendments that we could all offer on the floor, an open amendment process and a debate".
The proposal would raise the U.S. debt ceiling until March 2019.
Paul, a budget hawk from Kentucky, defended his one-man protest, arguing that the fresh commitments to extra spending in the Bill were reckless. Whatever happens, this week's budget battle dealt a clear immigration defeat to Democrats, who'd initially vowed to block spending bills until there was a deal to help the Dreamers.
Paul, acknowledging the criticism from members of his own party, said he was "drawing attention to the debt" and added "I didn't come up here to be liked". Her opposition was due to the lack of a permanent solution for the Deferred Action for Childhood Arrivals program. The White House said in a statement that the president would sign them into law.
The deal was long expected to have bipartisan support to pass in the Senate.
The House minority leader, Nancy Pelosi, planned to oppose the bill, and despite suggesting that she would not pressure her colleagues to follow suit, appeared to be doing just that.
"To anyone who doubts my intention to solve this problem and bring up a DACA and immigration reform bill: Do not", Ryan said at a news conference.
Paul objected to the fact that deal would result in a significant increase in the federal budget deficit without any corresponding cuts to spending.
For Democrats like Marcia Fudge (D-Ohio), a member of the Congressional Black Caucus, the decision was simple: "I can not in good conscience go home and say to my [hospitals that serve low-income patients] that I didn't vote for this because of DACA".
But the administration has said that deporting Dreamers would not be a priority. The upper chamber of Congress closed up shop late Thursday and reopened in the dark of night for a new session at 12.01 am (0501 GMT) Friday, launching a new effort to pass a bill to extend federal funding for six more weeks. Three weeks ago, Senate Democrats dug in and chose to use a deadline to try to force Republicans to work with them on a deal for "Dreamer" immigrants, whose protections from deportation are due to expire in March. "I think it's important that we have this debate", he said.