After a weeks-long slog, Congress united on Thursday night to pass a massive federal spending bill that averts a second shutdown, just weeks after the longest government closure in the nation’s history.

Although the package funds nine departments, comprising roughly a quarter of the federal government, the lengthy impasse surrounded just one: the Department of Homeland Security, which would oversee the construction of new barriers on the U.S.-Mexico border.

ADVERTISEMENT

President Trump Donald John TrumpOmar fires back at Trump over rally remarks: 'This is my country' Pelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Trump mocks Biden appearance, mask use ahead of first debate MORE had demanded $5.7 billion in funding for new construction of his signature border wall, launching a drag-out fight with Democrats, who rejected the provision outright, and leading to a five-week partial shutdown beginning Dec. 22.

In a blow to Trump, the new spending package has no funding for the concrete border wall that stood as the central promise of his 2016 campaign — an exclusion that Democrats are trumpeting as evidence that they won the long partisan standoff.

But Trump is expected to announce an emergency declaration to unearth new funds for his wall, which will also set up a fight in the courts.

Here’s an early list of winners and losers from the drawn-out fight.

WINNERS

Speaker Nancy Pelosi Nancy PelosiPelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare House lawmakers reach deal to avert shutdown Centrist Democrats 'strongly considering' discharge petition on GOP PPP bill MORE

Late last year, the California Democrat was confronting an internal revolt and securing the gavel only after agreeing to a self-imposed cap on her remaining years at the top of the party. Yet her handling of the tense budget negotiations — and her unwavering refusal to cave to Trump’s demands amid the lengthy shutdown — have boosted her power within the diverse caucus and solidified her stature as the face of the Democrats’ anti-Trump resistance.

Pelosi’s face-off with Trump in the Oval Office in December set the early tone for the negotiations, sending a clear signal that the California Democrat wasn’t ready to cave in her opposition to the border wall. Instead, it was Trump who folded, accepting just $1.375 billion in new fencing and levee walls — a far cry from the $5.7 billion he’d demanded initially — and igniting a firestorm of criticism from conservatives infuriated he didn’t take the fight to the wire.

In the process, Pelosi also secured billions of dollars in new funding for a host of Democratic priorities, including a $1 billion increase to conduct the 2020 census, a $500 million hike in public housing funds, $1.9 billion for Amtrak and $310 million for National Endowments for the Arts and the Humanities.

“She made a very powerful case that she can stand up strong against the administration,” said Rep. G.K. Butterfield George (G.K.) Kenneth ButterfieldCongress must protect kidney disease patients during the COVID-19 pandemic The time for HELP is now: Senate should pass bill to expedite recovery following natural disasters Rep. Clyburn on Confederate statues: Mob action is no answer MORE (D-N.C.), “and she has proven to be a perfect fit for that position.”

House and Senate negotiators

In a Congress that’s practically defined by partisan bickering, the top negotiators of the Homeland Security deal proved the sides can discard their differences and find common ground, even on an issue as highly contentious as border security.

Despite grumbling from some lawmakers on the 17-member conference committee, the four leaders of that panel — Sens. Richard Shelby Richard Craig ShelbySenate GOP eyes early exit Dems discussing government funding bill into February GOP short of votes on Trump's controversial Fed pick MORE (R-Ala.) and Patrick Leahy Patrick Joseph LeahyBattle over timing complicates Democratic shutdown strategy Hillicon Valley: Russia 'amplifying' concerns around mail-in voting to undermine election | Facebook and Twitter take steps to limit Trump remarks on voting | Facebook to block political ads ahead of election Top Democrats press Trump to sanction Russian individuals over 2020 election interference efforts MORE (D-Vt.) and Reps. Nita Lowey Nita Sue LoweyTop House Democrats call for watchdog probe into Pompeo's Jerusalem speech With Biden, advocates sense momentum for lifting abortion funding ban Progressives look to flex their muscle in next Congress after primary wins MORE (D-N.Y.) and Kay Granger Norvell (Kay) Kay GrangerGOP women's group rolls out six-figure campaign for Ernst Bottom line Helping our seniors before it's too late MORE (R-Texas) — defied their doubters to hash out a compromise with two days to spare before another scheduled shutdown.

To do so, the Republicans had to dismiss the criticisms from conservative voices bemoaning the absence of border wall funding, while the Democrats shrugged off attacks from the left protesting provisions for fencing and interior enforcement.

The four leaders — all of them top appropriators — had plenty of history to draw on. Between them, they have a whopping 128 years of experience on Capitol Hill. Pelosi, for one, said the key to the agreement was giving those lawmakers space.

“That’s real progress, I think, for us to have left it to the appropriators to make the decisions,” she said Thursday, shortly before the vote.

Women as leaders on a powerful committee

Lowey and Granger are the first two women to lead the House Appropriations Committee, and in their first negotiation they won a deal on border security that will prevent another shutdown.

The two veteran lawmakers enjoyed good press for their achievements.

In an interview with CNN’s Dana Bash, they said that if it had just been up to them, the deal would have come around even faster.

“Give us an hour. 30 minutes,” said Granger.

“We're very straightforward. We also know our own position and each other's position,” Lowey told CNN.

In a House with the most women members in history, the fact that Lowey and Granger were in on the final deal was not unnoticed.

Federal workers

The nation’s 2.1 million federal employees won a victory in the spending package with the inclusion of a provision lending them a 1.9 percent pay raise, retroactive to the start of the calendar year. The increase falls short of the 2.6 percent given to military personnel, and House Democrats — who had promoted the higher figure for nondefense workers — are already vowing to keep up that fight.

“I think it should be 2.6 [percent]. And in the future, I will pursue that,” House Majority Leader Steny Hoyer Steny Hamilton HoyerOn The Money: Powell, Mnuchin stress limits of emergency loans | House seeks to salvage vote on spending bill | Economists tell lawmakers: Kill the virus to heal the economy House moves toward spending vote after bipartisan talks House Democrats mull delay on spending bill vote MORE (D-Md.) said Wednesday.

In the meantime, however, advocates for federal employees say they’re pleased with the 1.9 percent bump — and that they dodged a bullet by avoiding another shutdown. The first closure had left roughly 800,000 federal employees either furloughed or working without pay for five weeks.

David Cox, president of the American Federation of Government Employees, said many workers are still awaiting back pay and are facing “massive backlogs” of work from the last episode.

“Federal employees — and the American public they serve — cannot go through another shutdown,” Cox said in a statement.

LOSERS

President Trump

The president shut down the government for 35 days over demands that Congress give him $5.7 billion for a wall on the southern border. In the end, Congress gave him no money for his concrete wall and just $1.375 billion — less than a fourth of what Trump requested — for 55 miles of physical barriers in Texas’s Rio Grande Valley.

It’s a huge let down, not only for Trump but for immigration hawks in Congress, groups pushing for immigration restrictions like FAIR and NumbersUSA, and the president’s grass-roots conservative base.

Fox News host Sean Hannity, one of Trump’s usual allies on cable news, trashed the deal as a “garbage compromise.” Fox’s Laura Ingraham called it a “Total SCAM!”

Trump is expected to declare a national emergency on the border — a move that he believes gives him the authority to shift hundreds of millions of dollars from other pots to pay for his border wall.

That move could play well with his base, but it’s also a move that could have been made weeks ago. And it will face serious court challenges.

Trump and Republicans do have other reasons to crow. They beat back a Democratic effort to cap the number of detention beds for undocumented immigrants apprehended inside the country.

They also think the legislation leaves Trump the flexibility to shift funds unilaterally in order to fund his wall and increase the number of detention beds, even without explicit congressional approval.

House conservatives

In December, conservative leaders, including House Freedom Caucus Chairman Mark Meadows Mark Randall MeadowsHouse moves toward spending vote after bipartisan talks House Democrats mull delay on spending bill vote Southwest Airlines, unions call for six-month extension of government aid MORE (R-N.C.), lobbied Trump to shut down the government if Democrats didn’t cave and agree to fund his wall.

Trump listened to that advice — and has ended up with less money, and fewer miles, for the wall than Senate Republicans and Democrats had negotiated last year.

Last summer, Senate appropriators agreed to set aside $1.6 billion to build 65 miles of border fencing. The bipartisan pact passed by Congress this week hands Trump just $1.375 billion for 55 miles of physical barriers.

It’s unclear if Trump will continue listening to Meadows and other unofficial advisers on the right who helped lead Trump down this path. While Trump sided with the Freedom Caucus in using his executive authority, he ignored the conservative group’s proposed one-week stopgap funding measure designed to give the president more time to negotiate a better deal.

Instead, he signed the longer-term agreement that Senate Majority Mitch McConnell Addison (Mitch) Mitchell McConnellPelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Senate GOP aims to confirm Trump court pick by Oct. 29: report Trump argues full Supreme Court needed to settle potential election disputes MORE (R-Ky.) and others on Capitol Hill were begging him to support.

Federal contractors and women programs

Federal workers got back pay from the 35-day shutdown over December and January, as well as a nearly 2 percent pay raise.

Thousands of federal contractors weren’t as lucky.

Despite an eleventh-hour push by Democrats, back pay for federal contractors who didn’t get paychecks during the longest shutdown in U.S. history was left out of the final funding package. That includes people like custodians and security guards, as well as defense contractors and consultants.

Key GOP leaders and appropriators rejected the back pay, especially since Trump was signaling to Republicans on the Hill that he wouldn’t sign anything that included the back pay provision.

Negotiators also weren’t able to come to an agreement on an extension of the Violence Against Women Act (VAWA), which provides grant funding for programs to combat sexual and violent assault against women.

That means VAWA programs will expire at midnight Saturday.