WASHINGTON — A $1.3 trillion spending bill was approved by the House and sent to the Senate on Thursday after a flurry of unsuccessful Democratic efforts to stall it and force legislators to take up a measure to protect young immigrants brought to the country illegally as children.

The vote came as legislators faced a deadline of Friday for a government shutdown. It also came just hours after the release of the 2,232-page bill, meaning that few voting on the bill had a clear idea of what it included, as several members openly admitted.

The measure passed 256-167. The Senate began debating the bill Thursday afternoon and is expected to pass it. But objections from Sen. Rand Paul, R-Ky., over the speed at which leaders are trying to push through the bill were threatening to prevent the Senate from holding a final vote until the weekend.

That raised the prospect of another short-term government shutdown _ the third this year _ since funding will run out Friday. Paul forced a similar hourslong shutdown in February over a similar complaint that leaders were ramming through a complicated bill. He can't block passage, but under Senate rules he can slow the process.

Supporters of the bill said it was the best possible outcome in the current partisan climate.

"It is no way a perfect bill," Rep. Pete Sessions, R-Texas, said as he introduced it as a bipartisan achievement. "That, I think I learned a long time ago, is hard to get through and signed by the president."

Before the vote, Democrat Steny Hoyer of Maryland hefted a foot-tall stack of papers that, along with a second similar-sized stack, represented the bill and its back-up documentation. He slammed them onto a table.

"I ask any member, any member of this House, to join me in the well if you've read this bill," Hoyer thundered as he demanded a delay in the voting. "No one is joining me. Ladies and gentlemen of America, I have not read this bill."

Democrats sought to derail the measure to force the House to vote on their long-delayed effort to protect the young immigrants, known as "Dreamers," from deportation. They had been protected by an Obama administration program that President Donald Trump canceled, but has been kept operating under a temporary court order pending legal challenges.

But no deal acceptable to Democrats, Republicans and Trump could be put together by the deadline for inclusion in the massive spending bill. Republicans have refused a simple up-or-down vote on protections for those immigrants, and Trump has demanded full funding for his proposed border wall as well as cuts in legal immigration.

"When will they have their moment of opportunity, a reprieve from worrying, from looking over their shoulders every day?" asked Rep. Darren Soto, D-Fla. "When will the Dreamers finally get to dream?"

House and Senate negotiators reached tentative agreement late Wednesday on a deal for the spending bill, which significantly boosts defense and domestic spending even as it puts off several issues on which legislators could not find a compromise.

Among the spending was what Republicans described as the largest boost to the military in 14 years, as well as additional money for domestic programs such as school safety, transportation, education, science and the financing of efforts to blunt opioid abuse.

In a moment that was somewhat jarring given past Republican efforts to curb domestic spending, Rep. Tom Cole, R-Okla., lauded the measure's inclusion of spending for child care programs, scientific research and other items.

"Money well spent," he said.

The appropriations bill followed a February deal in which leaders agreed to add tens of billions of dollars to defense and non-defense spending over the next two years. The new spending levels, if approved by both houses, will begin Saturday and extend through September.

Republicans pushed the bill as a way to make up for defense cutbacks under Obama administration-era budget deals. Senate Majority Leader Mitch McConnell of Kentucky, introducing the bill in his chamber, noted that it included a 2.4 percent salary increase for service members.

"This has been a top priority on our side of the aisle," he said.

The measure also included a host of measures that gained ground after several recent mass shootings. They included strengthening the national background check system, financing efforts to train school officials to spot potential assailants before they act, and a statement that gives the Centers for Disease Control and Prevention permission to research the impact of gun violence. Since 1996, a spending measure had been interpreted as banning gun research.

Even as members lauded themselves for passage of the long-overdue measure — the funding year has already included five resolutions to keep the government running and two separate shutdowns — antipathy about both the process and the spending included in it was obvious.

"It's not what's in the bill that I have a problem with, it's what I don't know is in the bill," said Rep. Jim McGovern, D-Mass. "This place is broken, this process stinks."

For some Republicans, the combination of heightened military spending and domestic funding demanded by Democrats was too much. Not only Democrats but some Republicans on Thursday noted that had the bill been put forth under Democratic control of Congress or the White House, Republicans would have reacted with disdain.

Sen. Bob Corker, a Republican from Tennessee who is retiring, said the spending bill could serve as evidence that the Republican Party had "lost its soul."

"It does have to be a wake-up call for people as to whether that's the case," he said. "I'm discouraged about where we are today. I'm discouraged that we continue to be engaged in generational theft."

Trump, whose proposed budget was largely ignored by the congressional negotiators, signaled through aides on Thursday that he would sign the measure once it is approved by the Senate.

"Is it perfect? No," said Mick Mulvaney, Trump's budget director. "Were we ever going to get that? No. That's not how the process works."