The Senate voted Thursday to pass a short-term funding extension as lawmakers race the clock to avert a partial government shutdown at the end of the week. (Win McNamee/Getty Images)

 (CNN) — Congress passed a short-term funding extension Thursday, averting a partial government shutdown at the end of the week after lawmakers raced the clock ahead of a key Friday deadline.

The bill will now be sent to President Joe Biden to be signed into law. The Senate voted first to pass the measure by a tally of 77 to 18. The House passed the bill later in the day, 314 to 108.

But major challenges still lay ahead. Lawmakers must now attempt to pass a series of full-year spending bills before new March deadlines – a painstaking process with a wide array of potential landmines as the two parties fight for competing policy priorities.

In a rare event, lawmakers had been confronting not one but two government shutdown deadlines early this year – on January 19 and February 2.

The short-term funding extension sets up two new funding deadlines on March 1 and March 8. The stopgap measure will provide more time for full-year appropriations bills to be negotiated and passed.

House Speaker Mike Johnson, who presides over an extremely narrow majority, has faced intense pushback from his right flank amid the government spending fight.

Johnson has been criticized by conservatives over a topline spending deal he struck with Senate Majority Leader Chuck Schumer, which would set spending at close to $1.66 trillion overall. Conservatives were also quick to criticize the proposal for a short-term funding extension after it was announced.

“This is what surrender looks like,” the far-right House Freedom Caucus posted on X.

Johnson has defended the topline agreement and said in a statement Sunday that the short-term spending bill “is required to complete what House Republicans are working hard to achieve: an end to governance by omnibus, meaningful policy wins, and better stewardship of American tax dollars.”

In addition to the effort to avert a shutdown, a group of Senate negotiators have been working to try to strike a deal on border security that could unlock passage of aid to Ukraine and Israel.

Top congressional leaders emerged from a Wednesday meeting with Biden at the White House hopeful that a deal on a national security supplemental aid package can be reached.

If a deal is reached in the Senate, however, its fate in the House will be uncertain. A number of House Republicans have warned that they don’t believe a Senate compromise on border security would be adequate to address the issues at the border and would be ready to reject such a measure.