Updated at 12:55 a.m. ET Friday
The Senate voted early Friday to pass a roughly $1.3 trillion spending bill to fund the government through Sept. 3. The move avoided a government shutdown.
The massive spending package easily passed in both the House and the Senate. The Senate vote was 65-32. The House approved it hours earlier 256-167. President Trump is expected to sign the measure.
The Senate's vote wrapped up what may be the last major legislative achievement ahead of the midterm elections in November. But the 2,232-page spending bill remained mired in controversy after leaders rushed the measure through rounds of speedy votes.
The massive spending measure includes significant boosts to U.S. military spending supported by the president and congressional Republicans, while Democrats secured boosts to domestic spending that most Republicans oppose.
Congressional leaders celebrated the legislation publicly while they worked behind the scenes to persuade skeptics to back the legislation. House Speaker Paul Ryan, R-Wis., joined other Republicans in highlighting the military spending increases.
"With the biggest increase in defense funding in 15 years," Ryan said in a statement Wednesday. "This critical legislation begins to reverse the damage of the last decade and allows us to create a 21st-century fighting force."
He is working to tamp down anger among conservatives over spending increases as well as changes to gun policy. Among their chief concerns, the legislation would usher in a period of trillion-dollar deficits at a time when Republicans have complete control of the federal government.
Members of the conservative House Freedom Caucus said Wednesday that they plan to oppose the bill over those concerns.
"That is not in any way close what the election was about, close to what we campaigned on," said Ohio Republican Jim Jordan. "Not close to what we told the American people we were going to accomplish if they gave us the privilege to serve and be in power."
Democrats are facing a separate set of frustrations from the left flank of their party. Many immigration advocates are angry that the legislation includes $1.6 billion in border security money without corresponding protections for immigrants currently protected under the Deferred Action for Childhood Arrivals Program.
Senate Minority Leader Charles E. Schumer, D-N.Y., focused instead on spending increases for domestic programs.
"Every bill takes compromise, and there was plenty here, but at the end of the day, we Democrats feel very good because so many of our priorities for the middle class were included," Schumer said. "From opioid funding to rural broadband, and from student loans to child care, this bill puts workers and families first."
The agreement is loaded with dozens of unrelated policies, known as "riders," ranging from gun control to election security aimed at wooing skeptical lawmakers to back the deal.
Adding riders is a common — if sometimes controversial — practice used by both parties and the president to jockey for their priorities because they are guaranteed to become law on a must-pass spending bill.
The fight over border security and immigration became a major drag on negotiations in recent weeks with both sides refusing to negotiate.
The White House initially wanted $25 billion, but Democrats pushed for a far smaller amount with explicit restrictions on how the money could be spent.
The final $1.6 billion agreement would fund new fencing along roughly 30 miles of the border that was authorized under an earlier bill. Negotiators also reached a deal to repair existing fencing while explicitly protecting the Santa Ana National Wildlife Refuge in Texas.
The bill also includes nearly $700 million for election security, including additional money for the FBI to conduct counter-intelligence to fight Russian cyberattacks. States would benefit from an infusion of money for election technology grants to keep elections systems safe.
Negotiators included several bipartisan items, like $2.8 billion to battle opioid addiction as well as major funding increases for the Department of Veterans Affairs, federal highway projects and high-speed broadband development.
But what isn't included is nearly as significant as what made it in the bill.
The spending measure is widely expected to be one of the last must-pass bills to come up for a vote this year, meaning immigration has few opportunities for consideration in the coming months.
Looming midterm election and the reality that the political season will soon overtake any ability to advance any major legislation before Election Day.
Democrats remain frustrated that the bill does not deal with immigration. Many immigration advocates worry that DACA cannot pass if it is not included in a broader bipartisan bill.
Republicans also struck down a push to include subsidy payments that would help shore up the individual market places under the Affordable Care Act and partially subsidize premiums for some low-income workers.
AILSA CHANG, HOST:
Congress is less than three days away from another government shutdown deadline, and they have just released a $1.3 trillion bill that's more than 2,000 pages. There's only one problem. Nobody seems to know how they'll rush the legislation through before the Friday night deadline. NPR congressional reporter Kelsey Snell is here to walk us through what we know. Hey, Kelsey.
KELSEY SNELL, BYLINE: Hi, Ailsa.
CHANG: So 2,000 pages - that's huge. What's in this thing?
SNELL: It is a whopper of a bill based on that big budget deal that Congress passed after the shutdown earlier this year. Now, this bill takes care of funding the spending that that legislation set up. Now, Democrats and Republicans are both claiming a lot of victories here. That's partially because there's a little something for everybody in this bill. Republicans are celebrating big increases in military spending, and it's been in nearly press release and statement we've seen. And Democrats are celebrating more money for community health centers, early childhood education and fighting opioid addiction.
But there have been some troubles. That's in part because there was a slew of unrelated policy add-ons commonly known as riders. And they have been a real problem throughout this whole process. A few of the big highlights there - first, the bill would change the Federal Background Check system for gun purchases. So the different jurisdictions communicate with each other better when someone commits a crime. So if somebody commits a crime and then wants to buy a gun, it's more likely to be in this system.
SNELL: Another big item that was a big sticking point is money for border security. Now, you'll remember President Trump wanted $25 billion for building a border wall. Now, this includes about 1.6 billion, and that would only go toward building fencing along the border, repairing fencing and beefing up border security. Democrats are spinning it as a victory because the money would come with some tight restrictions - no money for a concrete wall or new immigration agents. And it would explicitly protect the Santa Ana Wildlife Refuge in Texas.
CHANG: Well, if both sides here got something that they want, what took so long for them to put this bill together?
SNELL: One major issue has been the fight over what to do about immigrants who are protected under Deferred Action for Childhood Arrivals. That's DACA. This does nothing for them even though that's the thing that Democrats shut the government down over earlier this year - over that exact same issue. And some conservatives, particularly in the House, are really not very excited. They're mad that there isn't money to build the wall. They are mad that the bill would add to the deficit. And they're mad that the bill includes money for domestic programs like Democrats are celebrating. Here's what Ohio Congressman Jim Jordan told reporters earlier today.
(SOUNDBITE OF ARCHIVED RECORDING)
JIM JORDAN: That is not in any way close to what the election was about, close to what we campaigned on, close to what we told the American people we were going to accomplish if they gave us the privilege to serve and be in power.
CHANG: Well, President Trump is often closely aligned with conservative Republicans like Jim Jordan. Do we know if the White House agrees with them? I mean, will they support his?
SNELL: Speaker Ryan and Majority Leader Mitch McConnell went to the White House earlier today to talk to the president specifically about the victories they see in this bill. After they left the meeting, the White House released a statement saying that they talked about victories and talked about supporting the spending bill. So as far as we know, the White House is on board.
CHANG: OK then. Well, how likely is it then that this deal still won't come through and we may be looking at another government shutdown?
SNELL: Leaders and staff keep promising me that we will not have another shutdown. All four leaders - House, Senate, Democrats, Republicans - all say they like the bill. The House has the tools available to speed things through, but there's always the Senate.
SNELL: Things can go pretty slowly here. And technically speaking, they have to wait through dozens of hours of debate before a bill can finally pass. But if all hundred senators agree, they can go fast. Now, all eyes are on Rand Paul because he forced a technical shutdown in February after he wanted the Senate to keep debating into the wee hours of the morning. We'll have to see how he feels now that the actual legislation is here.
CHANG: That's NPR congressional reporter Kelsey Snell. Thanks, Kelsey.
SNELL: Thank you. Transcript provided by NPR, Copyright NPR.