The House passed a massive $1.3 trillion spending bill Thursday, sending it to the Senate with just over a day to spare before the government would shut down for the third time this year.

The chamber approved the more than 2,200 page legislation — released only Wednesday night — by a 256-167 vote with bipartisan backing.

The legislation would fund the government through the end of September. It would significantly boost military spending and increase funding for border security, infrastructure and efforts to fight the opioid epidemic, among other programs. It also includes measures meant to strengthen gun sale background checks and improve school safety.

Earlier Thursday, the House narrowly cleared a procedural hurdle allowing its vote to take place later in the day. Some members criticized the rushed process and expressed concerns about the limited time to read and understand the massive legislation. If the chamber had not moved up the vote, the chances of at least a brief shutdown after the midnight Friday deadline would have greatly increased.

The hard-line conservative House Freedom Caucus mounted the most opposition to the spending bill in the House.

The legislation now goes to the GOP-controlled Senate, where it is expected to pass with bipartisan support. The chamber can also expedite a vote with approval from all senators present, but if any senators object, Senate rules could delay a vote until Friday or later.

Senate Minority Leader Chuck Schumer, D-N.Y., said both he and Senate Majority Leader Mitch McConnell, R-Ky., hope the chamber can vote on Thursday. He said he believes no Democrats will push to delay the vote.

Sen. Rand Paul, R-Ky., carried the Senate past a shutdown deadline last month as he objected to the budget deal that set up the massive spending increases contained in this week's bill. Paul could delay a vote again.

Still, the Senate could vote with at least a few hours' cushion before the shutdown deadline.

Leaders from both parties touted victories in the compromise bill, but acknowledged they made concessions. Republicans like House Speaker Paul Ryan promoted the boost to military funding and border enforcement efforts.

"What this ultimately is about is giving our military the tools and the resources it needs to do its job," he said.

Both major parties cheered increased funding to fight the opioid crisis and improve infrastructure.

Democrats touted provisions such as higher funding for child-care subsidies and low-income housing tax credits. They also got wins from what was not included in the legislation: measures championed by conservatives to pull funding for Planned Parenthood or so-called sanctuary cities.

The bill "is legislation that neither side sees as perfect, but which contains a host of significant victories and important achievements on behalf of the American people," McConnell said Thursday on the Senate floor.

Schumer also acknowledged concessions from both major parties on Thursday.

"Now, it certainly doesn't have everything Democrats want. And it contains a few things Democrats aren't thrilled about. The same is true of our Republican friends. That is true of all compromises " Schumer said.

President Donald Trump entered Wednesday hesitant to support the plan. Trump had concerns over such issues as the amount of money set aside for his proposed border wall, the lack of a sanctuary cities provision, and whether funding would go toward a rail tunnel connecting New Jersey and New York that he opposed.

Trump reportedly threatened to veto the bill if it put money toward the tunnel, which is part of the Gateway plan to revitalize rail transportation. The bill did not directly put money toward the project.

After Ryan went to the White House on Wednesday to sell Trump on the legislation, the administration said the president supported it. Trump sent a tweet Wednesday night in which he appeared to back the proposal.

Trump tweet

Ryan promoted the plan again Thursday morning on "Fox & Friends," a Fox News Channel morning show Trump frequently watches and tweets about.

Office of Management and Budget Director Mick Mulvaney reiterated Trump's support on Thursday and said he "looks forward to signing it." The president will support it "because it funds his priorities," Mulvaney said.

Here are some of the bill's notable provisions