President Joe Biden is expected to sign the legislation into law on Wednesday.
The Senate on Tuesday evening backed the measure passed by the US House of Representatives on Saturday.
It includes $61bn in military aid for Ukraine, which the Pentagon says can start being delivered to the war-torn nation "within days".
It passed in a bipartisan vote of 79-18.
Mr Biden hailed its passage in a statement late on Tuesday, calling it "critical legislation [that] will make our nation and world more secure as we support our friends who are defending themselves against terrorists like Hamas and tyrants like [Russian President Vladimir] Putin".
On Tuesday, Democratic Senate Majority Leader Chuck Schumer said the US had shown that it would not turn its back on its allies.
"After more than six months of hard work and many twists and turns in the road, America sends a message to the entire world: we will not turn our back on you," he said on the Senate floor.
The Senate had passed a similar aid package in February, but a group of conservatives who oppose new Ukraine support had prevented it from coming to a vote in the House of Representatives.
Last week, Democrats and Republicans in the lower chamber joined together to bypass this opposition.
They ultimately agreed to a package bill that included the foreign aid as well as legislation to confiscate Russian assets held by Western banks; new sanctions on Russia, Iran and China; and a provision that will force the Chinese company ByteDance to sell the popular social media service TikTok.
Sen Schumer said Republican Speaker of the House Mike Johnson had risen "to the occasion" when he pushed for passage of the foreign aid bill in his chamber.
"It was our bipartisanship, our linking of arms together that got this large and difficult bill through the Congress, despite many political ideologues, wanted to bring it down," he said earlier on Tuesday.
The bill also faced resistance among a handful of Senate Republicans who opposed any new aid to Ukraine.
Fifteen voted with two Democrats - as well as independent Senator Bernie Sanders who objected to providing new offensive weapons to Israel - against the bill.
"Pouring more money into Ukraine's coffers will only prolong the conflict and lead to more loss of life," Republican Senator Tommy Tuberville said in remarks on Tuesday.
"No one at the White House, the Pentagon, or the state department can articulate what victory looks like in this fight."
Republican presidential candidate Donald Trump had opposed new aid to Ukraine in the past, but during a radio interview on Monday he praised Mr Johnson for structuring some Ukraine non-military aid as a loan.
The foreign aid package passed on Tuesday also includes:
* $26.4bn in military support for Israel, with $9.1bn of that allocated to humanitarian aid for Gaza
* $8.1bn in funding for allies in the Asia-Pacific, including Taiwan, to "counter communist China".
According to the Biden administration, previously approved US aid to Ukraine had been exhausted by the beginning of the year.
Officials warned that the situation was dire and that Ukraine was in danger of losing its two-year-old war with Russia if Congress had not approved new support.
The national security package also includes a provision that could lead to a nationwide ban on TikTok.
The popular social media app's China-based parent company has nine months to sell its stake and find a US-approved buyer or see TikTok shut down across the US.
The statute gives the US president the option of extending the deadline by an additional 90 days, which means the latest the ban could take effect is nearly a year from now.
By Anthony Zurcher