The Senate on Thursday reached a last-minute deal on a sprawling $1.7 trillion package to keep the government funded through the next fiscal year -- and send more aid to Ukraine -- while getting one step closer to averting a shutdown just before Christmas.
The chamber voted 68-29 to pass the omnibus spending bill after speeding through votes on 17 amendments. Eighteen Republicans joined Democrats in approving the bill that would keep federal agencies operational through Sept. 30, 2023.
Senate Majority Leader Chuck Schumer, in a news conference after the vote, said it took "a lot of hard work, a lot of compromise, but we funded the government with an aggressive investment in American families, American workers, American national defense."
"It is one of the most significant appropriations packages we've done in a really long time," Schumer said.
The legislation will now go to the House for approval before making its way to President Joe Biden's desk.
The administration has signed off on the package despite it not including everything White House officials requested, such as more COVID-19 funding.
Speaker Nancy Pelosi, D-Calif., had said at her weekly press conference that the "hope" was the House could pass the bill on Thursday night but noted it takes several hours for it to pass between chambers.
But later Thursday, House Majority Leader Steny Hoyer said the chamber will vote on the omnibus bill Friday, giving members enough time to go through the text. The House will reconvene as early as 9 a.m. ET.
Lawmakers have been scrambling to get the bill across the finish line both before Friday's midnight deadline and before a powerful winter storm unleashes blizzard conditions and severe cold, making their travel home difficult.
The legislation includes disaster relief, medical services for military veterans, a ban of the use of TikTok on government-issued devices and reforms to the Electoral Count Act to avoid a repeat of the Jan. 6 attack.
Also included is $45 billion in humanitarian, economic and security assistance for Ukraine amid Russia's ongoing invasion. Ukraine's President Volodymyr Zelenskyy made a historic visit to Washington on Wednesday to make the case for continued aid, amid some calls from Republicans for more oversight, telling U.S. lawmakers the money "isn't charity."
"It's an investment in the global security and democracy that we handle in the most responsible way," Zelenskyy said.
How the deal happened
Schumer announced Thursday morning an agreement had been struck to expedite the process of passing the omnibus spending bill.
"I would say that the omnibus was an appropriate metaphor for the last two years ... a lot of ups and downs but in the end a great result that really helped the American people," Schumer said after the bill was passed.
Negotiations had hit a snag over an amendment from Sen. Mike Lee, R-Utah, that would have reinstated Title 42 -- the Trump-era order used to rapidly expel migrants since the early days of the COVID-19 outbreak on the basis of public health concerns.
A federal judge had ordered Title 42 to expire earlier this week, but Supreme Court Chief Justice John Roberts temporarily paused that ruling as the justices considers a request from Republican-led states to keep the policy in place.
Enough Democratic senators supported Lee's Title 42 amendment that it likely would have passed -- and doomed the whole bill to fail in the House, where the amendment doesn't have the same backing.
To push the legislation forward, Democratic leadership crafted a workaround by voting on two amendments related to Title 42. One brought forward by Sen. Kyrsten Sinema, I-Ariz., and Montana Democratic Sen. Jon Tester would've preserved Title 42 but included money for humanitarian assistance and border security and required 60 votes to pass.
The other, brought forward by Lee, required 51 votes to pass.
Neither Title 42-related amendment passed.
But several of the other proposed amendments did pass and will be included in the version of the omnibus bill being sent to the House.
Those amendments include the PUMP Act, which expands breastfeeding accommodations in the workplace, and the Pregnant Workers Fairness Act, which ensures people with limitations related to pregnancy or childbirth are not forced out of the workplace.
Senators also approved an amendment that will allow states and local jurisdictions to repurpose COVID-19 relief money for infrastructure, disaster relief or other issues.
A measure known as 9/11 Responder and Survivor Health Funding Correction Act that funds a shortfall in the 9/11 first responder fund called the World Trade Center Healthcare Program was also passed as an amendment to the omnibus bill, as was a bill to authorize $2.7 billion in compensation payments to the families of victims of the 9/11 terror attacks, the Beirut Marine barracks bombing and all victims of terrorism.
ABC News' Lauren Peller contributed to this report.