The bill passed 68-31 and now goes to President Biden's desk.
Nearly $14 billion in U.S. aid will go to Ukraine and European allies in the fight against Russia, including funds to provide humanitarian aid to the millions of Ukrainians who have fled, as well as funds for weapons.
Ukrainian President Volodymyr Zelenskyy appealed to lawmakers in a Zoom call on Saturday for more help in his country's fight against Russia.
The $1.5 trillion spending bill includes a 6.7% bump in domestic programs to $730 billion and a 5.6% increase in defense spending to $782 billion.
"The bipartisan product contains major wins for our national defense, for our friends in Ukraine, for the conscience rights of the American people, and for many other key priorities, and it keeps new left-wing poison pills out," U.S. Senate Republican Leader Mitch McConnell, Ky., said ahead of the vote.
Senate Majority Leader Chuck Schumer, D-N.Y., also praised the bill as bipartisan.
"When we're unable to find common ground, Democrats will hold firm in defense of our values and be willing to work alone, if needed. But this week, bipartisanship has propelled us over the finish line," Schumer said on the Senate floor Thursday evening.
President Biden had originally proposed a 16% increase in domestic spending and just 2% for defense last spring, but that became unrealistic due to the Democrats' slim majority and Russia's invasion of Ukraine.
Missing from the bill is $15.6 billion to combat the COVID-19 pandemic. House Democrats refused to accept Republican demands that new funding is paid for with cuts in previously passed pandemic aid.
"We’ve got a war going on in Ukraine," Pelosi told reporters Wednesday when explaining the compromise. "We have important work that we’re doing here."
House Democrats plan to hold a vote next week on the $15.6 billion in COVID-19 funds.
Congress was facing a deadline of Friday at midnight to pass the bill or a government shutdown would ensue.
The Associated Press contributed to this report.