On Wednesday night, congressional leaders unveiled the “omni”: a massive 2,232-page, $1.3 trillion spending bill covering everything from defense to border security to opioids. In Congress, a spending bill spanning multiple budget areas is known as an “omnibus.”

On Thursday, the House and Senate passed the bill. If signed by President Trump, the legislation will keep the government open through September 30, giving us at least six months without a major budgetary showdown.

But then, Trump threatened to veto the legislation, with only 15 hours left before a shutdown begins at the end of Friday night:

I am considering a VETO of the Omnibus Spending Bill based on the fact that the 800,000 plus DACA recipients have been totally abandoned by the Democrats (not even mentioned in Bill) and the BORDER WALL, which is desperately needed for our National Defense, is not fully funded. — Donald J. Trump (@realDonaldTrump) March 23, 2018

Trump eventually backed down and signed the bill, but his last-minute change of heart highlighted the precarious state the legislation has been in all week.

Passage in Congress wasn’t assured. While the Republican leadership originally scheduled release of the text for Monday night, it didn’t come for another two days, prompting consternation among some members of Congress.

Sen. Rand Paul (R-KY), who forced a brief shutdown in February to emphasize his opposition to increased federal spending, opposed the omnibus. So did the House Freedom Caucus, an influential subgroup of conservative members,, as well as the Heritage Foundation. House Democrats and Republican hardliners opposed the underlying rule allowing the bill to pass; the rule squeaked through, 211 to 207.

Then, the legislation faced its toughest challenge yet in Trump, who appeared completely supportive when the House and Senate passed it (House Speaker Paul Ryan announced on Thursday, “The president supports this bill, there’s no two ways about it”). While he buckled eventually, Trump’s waffling is an indication that he might be more inclined to defect from Congressional leaders on budget questions going forward.

How we got here

Congress set the current funding deadline of Friday, March 23, in early February, when party leaders arrived at an agreement to boost domestic spending by $128 billion and defense spending by $160 billion over two years. The deal included a variety of specifics, including new funding for disaster relief and opioid treatment, but more specifically, it extended current spending levels until March 23 and trusted Congress to use the intervening time to pass appropriations bills (or one big omnibus deal) in accordance with the terms of the deal.

That deal was announced on February 7 and passed shortly thereafter. But Congress, being itself, didn’t hammer out all the details of the omnibus spending bill that the deal called for until … right now, more than a month later.

That allowed certain aspects of the budget debate to resurface, surrounding everything from the Deferred Action for Childhood Arrivals (DACA) program giving deportation protections to unauthorized immigrants who arrived as children (a program that Trump has shut down and lawmakers have been scrambling to revive in some form) to border security to, in the aftermath of the school shooting in Parkland, Florida, gun control.

The delay also allowed resentment to fester about the scale of the spending hikes envisioned in the deal. Most Republicans were broadly supportive of the massive defense spending increase; the White House has bragged that it’s the “largest pay raise for our troops in a decade.”

But the more libertarian, limited-government wing of the party generally prioritizes cutting domestic spending over boosting defense spending, and has pushed back against the February deal as allowing profligacy on all fronts. That spurred Rand Paul’s forced shutdown last month and is motivating the opposition of conservatives like the Freedom Caucus and the Heritage Foundation.

What the omnibus actually does

The whole point of omnibus legislation is that it’s kind of a cobbled-together mishmash of provisions and priorities. As Vox’s Tara Golshan notes, the bill resolves a number of serious disagreements present throughout the negotiation process for it:

Other issues that sparked less overt controversy are also addressed in the omnibus:

The National Institutes of Health get a $3 billion funding increase.

The Census Bureau will get another $1.34 billion, a Democratic priority.

The Community Development Block Grant program, a flexible federal funding program for cities and local governments, is being nearly doubled from $2.8 billion to $5.2 billion, despite Trump’s prior proposals to eliminate it.

TIGER, a grant program for transportation projects inaugurated by Obama’s stimulus, is seeing its budget tripled to $1.5 billion.

The bill includes the STOP School Violence Act of 2018, a measure to increase grants for security training, metal detectors, stronger locks, emergency notifications, and other provisions meant to improve school safety. It passed the House by an overwhelming bipartisan margin earlier this month.

For the first time ever, the Congressional Research Service (an indispensable nonpartisan agency producing invaluable reports on a wide variety of procedural and policy topics) will be required to post all of its reports online. Currently, only a subset are available to the public, mostly through third parties.

What happens now

As Vox’s Tara Golshan explains, the bill now proceeds through Congress in three stages:

First, the House passes a rule enabling passage, which will waive the normal requirement that members of Congress must have three days to read bills before voting. This has already happened, very narrowly, by a margin of only four votes due to both Democratic and conservative Republican opposition. 11 Democrats were shut out of voting when Republican leadership ended it early. Then the House passes the bill outright; this happened, 256-167, with significant minorities of both Democrats and Republicans opposed. Then, the Senate has to move. Because the legislation can be filibustered, it needs 60 votes, so at least nine Democrats have to support it. Ultimately, 65 Senators supported it, including almost all Senate Democrats, while 24 Republicans and 8 Democrats voted no. Finally, Trump has to sign it. This seemed like a sure thing. Then it didn’t. Then he signed it.

With Trump’s signature secured, Congress now has until September 30, the end of fiscal year 2018, to pass new legislation authorizing spending for the beginning of fiscal year 2019. About six months after that, in March 2019, the debt limit — which was suspended under the February 2018 spending deal — will become unsuspended and will need to be either suspended again or raised.

So even if all goes according to plan, expect to have very a similar fight in six months, and then again in a year.