President Biden signed legislation to fund the government through Feb. 18, averting a government shutdown that would have kept multiple federal services closed and employees out of work days before the holidays.

The stopgap funding bill cleared Congress on Thursday night after some delays partly caused by a small group of Senate Republicans who tried to seize on the imminent fiscal deadline to fight Biden over his vaccine mandate-and-testing policies. Had the measure not passed, Washington would have essentially come to a halt Saturday morning, a development that Democrats had described as irresponsible and dangerous in the middle of a deadly pandemic.

The stopgap measure means that, by Feb. 18, lawmakers must adopt another short-term measure or complete work on a dozen long-stalled appropriations bills that fund the government for the remainder of fiscal 2022, which ends in September.

The funding bill, known as a continuing resolution, passed the Senate on a bipartisan 69-to-28 vote late Thursday evening. Earlier in the day, it passed the House largely along party lines. Illinois Rep. Adam Kinzinger, who is retiring at the end of his term, was the only Republican to vote for it.

The measure covers key federal agencies and programs until February and authorizes an additional $7 billion to assist Afghan refugees. Another $1.6 billion appropriated in the bill will fund care for unaccompanied children who crossed the southern border and are in U.S. custody. Funding for the care of unaccompanied children was also a feature of budget bills passed during the Trump administration.

The bill, however, doesn’t address an array of unresolved policy issues and program funding that lawmakers had hoped to tackle before the end of the year, including impending cuts to Medicare and farm subsidies.

On Friday morning, Biden called the stopgap measure “a great achievement,” but also the “bare minimum” one could expect from Congress. Biden thanked House Speaker Nancy Pelosi (D-Calif.), Senate Majority Leader Charles E. Schumer (D-N.Y.) and Senate Minority Leader Mitch McConnell (R-Ky.) for ensuring passage of the bill and urged Congress to finalize a full spending bill in the coming weeks. Biden also thanked Senate Appropriations Committee chair Patrick J. Leahy (D-Vt.), vice chair Richard C. Shelby (R-Ala.), and Rep. Rosa L. DeLauro (D-Conn.), who chairs the House Appropriations Committee.

“I want to thank the substantial bipartisan vote in the Senate for sending this bill to my desk today to avoid disruption of government operations,” Biden said Friday. “I want to urge Congress to use the time this bill provides to work toward a bipartisan agreement on a full-year funding bill that makes the needed investments in our economy and our people, from public health, to education, to our national security.”

Mike DeBonis and Tony Romm contributed to this report.