Congress is on its way to pass a $1.3 trillion funding package, a last-minute deal that left most legislators with less than 36 hours to review and vote on the 2,232-page bill to avert a shutdown on Friday. The House passed the bill Thursday afternoon, and it is now on to the Senate.

The final spending deal beefs up military and domestic spending and includes $1.6 billion for the southern border wall, with some restrictions, and patches up some flaws in the GOP tax bill. It also devotes $3.2 billion more to combat the opioid epidemic, and includes the Fix NICS Act, reinforcing existing gun background check laws.

This Congress is coming off two government shutdowns in the last three months. The first shutdown came in January and lasted for three days, during a standoff over the future of the Deferred Action for Childhood Arrivals program. Then in February, Sen. Rand Paul (R-KY) effectively shut down the government himself, this time only for a few hours overnight, in a stand against a deal negotiated by congressional leaders that would bust the government budget caps on domestic and military spending that have been in place since 2013.

Big legislative fights over gun control and DACA were largely off the table this time. And having kicked down any permanent solution to government spending since September 2017, and currently on their fifth short-term spending bill, Congress’s more permanent funding package would carry them through to the start of the new fiscal year on September 30.

But after weeks of head-butting between parties, which slowed down negotiations, compromises over controversial issues like hiking spending for the Department of Homeland Security to expand the number of immigrant detainee beds, the border wall and infrastructure spending, have angered the flanks of both parties. Already House conservatives voted against the bill, railing against the high spending numbers and lack of right-wing policy priorities — meaning the final package had to attract more Democratic votes. Another conservative revolt in the Senate likely wouldn’t have enough support to block the bill altogether, but could delay passing the spending package by the midnight deadline Friday.

Republicans look like they have enough Senate Democrats to sign on to their spending agenda for it to pass the filibuster rule. And for now, it seems the White House is on board with the spending bill, despite reports Wednesday afternoon indicating Trump wasn’t too pleased with the outcome. With the midterm elections around the corner, there’s little appetite in Congress for another government shutdown, and lawmakers seem more willing to let their controversial policy priorities fall to the side, which makes this final push a race against the clock.

This spending bill took a lot of compromise

In February, lawmakers set themselves up to reach a more permanent spending agreement by the end of March. Congress agreed to increases to domestic and defense spending over the next two years, raising funding for domestic programs by $128 billion and hiking defense budgets by $160 billion. But they didn’t actually decide where the money would go.

Since passing the budget deal, appropriators — the lawmakers in charge of the nation’s purse strings — have been negotiating how to allocate the money. In the last couple of days lawmakers were still butting heads over 20 to 25 provisions, one Democratic aide close to negotiations said.

Now they have come to an agreement. This bill would fund the government through the end of September — the end of the 2018 fiscal year — and come in the form of an omnibus, which jams together 12 individual appropriations bills into one funding package.

On immigration, lawmakers went into the week at odds over a Republican call to hike funding for DHS to boost interior enforcement of illegal immigration, which Democrats say will only increase efforts to deport nonviolent undocumented immigrants, who are typically deprioritized. They have reached compromise, funding and additional 328 additional Customs and Border Protection officers, but requiring Immigration and Customs Enforcement to reduce the number detention beds.

Funding for the border wall was also included — $1.6 billion will be allocated for Trump’s pet project, far less than the White House last minute as for all $25 billion, and with some strings attached.

The spending bill also increases funding for the National Institute of Health by $3 billion and puts $3.2 billion toward the opioid epidemic.

Several major issues were notably dropped from the final package, namely a push to stabilize the Obamacare markets. After Republicans voted to repeal the Affordable Care Act’s individual mandate, which taxed individuals for not having health insurance, premiums are expected to rise by 10 percent, according to projections from the Congressional Budget Office. Conservatives derided the whole effort as “bailing out” a failed health care policy and Republican leaders pushed to attach language that would prevent the Obamacare payments from going toward any insurance plan that covers abortions — which Democrats say would adversely impact low income women. With neither party willing to concede, the Obamacare stabilization funding was dropped all together.

The $900 million proposal for the Gateway infrastructure project, to construct a commuter rail tunnel between New Jersey and New York under the Hudson, was also left out the deal. Instead, the spending bill will include $446 million through Amtrak and federal grants that do not require the Department of Transportation’s stamp of approval, that can go toward Gateway.

Now leaders have to convince their ranks to support the bill before the government shutdown deadline Friday.

Now it’s a race against the clock

It’s clear House Speaker Paul Ryan and Senate Majority Leader Mitch McConnell eager to get this done, so Congress can go on recess.

But with a deadline on March 23, they don’t have much time, and a lot of procedural hoops to go through.

On Thursday the House passed a rule saying the spending legislation could bypass a typical three-day sitting period between a bill’s release and the vote, and the omnibus sailed through the final vote, passing with bipartisan support less than 18 hours after the bill was released.

But in the Senate, like with the last shutdown, any senator can take over the floor and push the debate passed the shutdown deadline.

There are already signs that Sen. Rand Paul (R-KY), who orchestrated the last shutdown almost single-handedly because of his frustration with the high spending levels, isn’t happy with this bill. He told reporters he’s still “undecided” on how he will act on the bill, but tweeted frustrations with the final compromise. Sen. John Kennedy (R-LA), who called the omnibus a “great-dane-sized whiz down the leg,” also expressed frustration with the bill.

And, as with all spending bills, the final say comes down to Trump, who was originally unhappy with the final product. After House Speaker Paul Ryan met with Trump earlier Wednesday, the White House released a statement saying the president supported the spending package, despite reports that Trump was weighing a veto.

Democrats dropped their DACA demands

Behind both government shutdowns this year was a policy fight not directly tied to government spending: immigration.

In January, Senate Democrats, frustrated with Trump’s unwillingness to accept a bipartisan proposal to address the nearly 700,000 immigrants in legal limbo under DACA, orchestrated a shutdown with the support of some Republicans. The result was a failed and inconclusive Senate floor debate on the issue.

Again in February, a conservative revolt over the budget deal meant that House Republicans, who have a big enough majority to pass legislation without Democratic support, suddenly needed votes from across the aisle. Rand Paul shut down the government over frustration with the budget, and House Democrats had to decide whether they would sign on to reopening it without any gains on immigration. Ultimately, House and Senate Democrats voted for the final bill.

Democrats changed their tune on DACA and seem less interested in tying big policy priorities, including issues like gun control, to the spending fight. A DACA fix “doesn’t have to be on the omnibus bill,” House Minority Leader Nancy Pelosi said last week.

Meanwhile, Trump had some immigration priorities of his own, including fully funding for the border wall and his call for Congress to defund “sanctuary cities,” is only getting a small par of his ask.

It’s clear members of Congress, including Republicans, don’t have much of an appetite for larger policy fights outside of the spending bill.