The legislation would set up a two-year, $300 billion boost in spending on the military and domestic programs. It would also extend the debt ceiling, authorize nearly $90 billion in aid for last year's string of natural disasters, give funding to fight the opioid crisis and extend the popular Children's Health Insurance Program for an additional four years.

Sen. Rand Paul, R-Ky., mounted hours of solo resistance to the budget deal over what he called reckless spending. He repeatedly objected to efforts by senators to quickly move to a vote on the agreement.

The Senate passed a short-term funding bill and cleared the way for a boost to military and domestic spending. Senators voted 71-28 to approve the deal, but the chamber failed to do so before the clock turned to Friday and government funding lapsed.

Congress moved one step closer early Friday to setting a major spending increase, following hours of drama on the Senate floor that led to the second partial government shutdown in less than a month.

Senate Majority Leader Mitch McConnell (R-KY) walks from a vote on Capitol Hill after the senate voted to advance a bill financing the U.S government January 22, 2018 in Washington, DC.

The bill differs from a stopgap spending measure passed by the House on Tuesday night. Therefore, the House will have to vote separately on the Senate-passed legislation to send it to President Donald Trump's desk for his signature.

House Speaker Paul Ryan expects the chamber to pass the bill despite opposition on both sides of the aisle. The House could vote by roughly 6 a.m., ET, on Friday.

Trump, who said earlier this week that he would "love" a government shutdown, tweeted his support for the budget deal on Wednesday.

Efforts to fast-track the bill through the Senate got delayed as fiscal conservative Paul objected to the spending levels included in it.

"I can't in all good honesty, in all good faith, just look the other way because my party is now complicit in the deficits," the senator said on the Senate floor.

Paul objected to repeated requests to vote on the measure Thursday, leading Senate Majority Whip John Cornyn to say he would "effectively shutdown the federal government for no real reason."

As Paul railed against lifting spending caps, the nonpartisan Congressional Budget Office estimated that the bill would cost about $320 billion. Most of that would come in the first year.

Approving the bill is the first step toward passing a two-year budget deal reached by bipartisan congressional leaders. It funds the government through March 23 while lawmakers work on an appropriations bill with the levels set out by Congress.

Lawmakers will then have to pass appropriations legislation for both the current fiscal year that ends Sept. 30 and the following year.

But opposition in the House to the broader pieces of the budget agreement threatens to complicate matters even more.

"Part of it depends on the Democrats, this is a bipartisan bill," Ryan told radio host Hugh Hewitt on Thursday morning. "It's going to need bipartisan support. We are going to deliver our share of support. I feel very good about Republicans."

Some House conservatives signaled that would vote against the plan due to the spending increases. Meanwhile, House Minority Leader Nancy Pelosi, D-Calif., and some of her caucus oppose it because it does not include legal protections for hundreds of thousands of young undocumented immigrants.

Pelosi wanted assurances that Ryan would have an open debate on an immigration bill. Ryan committed Thursday to bring up an immigration bill that Trump would support. However, he did not go as far as Senate Majority Leader Mitch McConnell, R-Ky., who will start an open amendment process on immigration next week.

It is still unclear if the Senate negotiations will yield an immigration deal that can garner enough support in the more conservative House.

McConnell and Minority Leader Chuck Schumer, D-N.Y., announced the framework of the budget deal on Wednesday afternoon.

McConnell said Wednesday the bill is not "perfect" but added that "we worked hard to find common ground and stay focused on serving the American people." While acknowledging that both sides had to make "painful" concessions to strike the deal, Schumer called it a "win for the American people" and a "genuine breakthrough."

The deal includes:

A $165 billion increase in military spending

A $131 billion boost to domestic program spending

Nearly $90 billion in funding for disaster relief efforts in Texas, Florida and Puerto Rico

Two years of funding for community health centers

Another four-year extension of the Children's Health Insurance Program, for a total of a decade

Funding for existing infrastructure programs related to transportation, drinking water and broadband

Correction: This article has been updated to clarify the status of the Senate vote.