The US Congress has passed a bill to temporarily avoid a partial government shutdown ahead of a Friday deadline to approve a budget deal.
The bill will go to the White House for President Joe Biden's approval, after the Senate ratified it on Thursday.
The stop-gap bill extends funding for federal agencies later into March.
Lawmakers in the Senate voted 77-13 to pass the legislation on Thursday, hours after it passed in the House by a 320-99 margin.
Under the legislation, the funding deadline for several departments, including Transportation, Housing, Agriculture and Veterans Affairs, will be pushed to 8 March.
Funding for some other federal government agencies will expire 22 March.
Speaking on the Senate floor before the vote, Democratic Senate Majority Leader Chuck Schumer of New York said lawmakers had "overcome the opposition of the Maga hard right" and provided a way to "not shut the government down and capitulate to extremists".
"Now, let's finish the job of funding the government so we don't have to do this again," he said.
In a statement, Mr Biden also called the passage of the bill "good news for the American people".
"But I want to be clear: this is a short-term fix—not a long-term solution," he added.
Democrats and Republicans have been far apart in the budget negotiations on border security and aid to Ukraine.
Republicans control the House by a slim majority, while Democrats hold the Senate by a single seat.
The Republican House speaker has faced fierce opposition from right-wing lawmakers in his ranks who want spending cuts and insist any further support for Ukraine should be tied to more money for US border security.
There have been 10 US government shutdowns or partial shutdowns over the past four decades.
If a deal had not been reached, around 20% of government departments would have had to temporarily close this weekend. Past shutdowns have also led to furloughs of government workers and the closure of national parks.
A bipartisan group of House and Senate lawmakers were finally able to strike a deal to avoid a shutdown on Wednesday.
The measure, known as a continuing resolution, or CR, includes agreements on six of the 12 annual spending bills. That leaves six other spending measures that lawmakers still have to decide on and pass over the coming weeks to avoid a shutdown.
Republican House Speaker Mike Johnson hailed the passage of the measure, arguing that it was a smart move to break up the budget into "smaller pieces".
"This was an important thing," he told reporters.