An end to the 40-year-old ban on the exporting of U.S. crude oil. Delays in the collection of two unpopular Obamacare taxes. A major increase in research funding for the National Institutes of Health. A permanent extension of benefits to treat first responders poisoned by the toxic air above Ground Zero in the aftermath of September 11, 2001. Restrictions on the ability of the IRS and SEC to regulate political activity by tax-exempt groups.

Those were just a few of the key policy changes that congressional negotiators agreed to as part of an enormous tax-and-spending package released in the wee hours of Tuesday night. The spending portion of the deal clocks in at 2,009 pages and contains $1.15 trillion in funding for the federal government through next September. Congressional leaders posted another 233 pages of tax policy, which makes permanent dozens of important tax breaks for individuals and businesses. That measure could cost at least $650 billion over the next decade and possibly as much as $780 billion, according to one preliminary estimate.

And don’t expect most members of Congress to read the thousands of pages of text before they vote on it: In a rush to complete their work and return home for Christmas, the House and Senate plan to pass the bills by Friday. “Let me be the first to say, I don’t think this is the way government should work,” House Speaker Paul Ryan lamented to reporters on Wednesday morning, even as he crowed about some of the victories that Republicans secured in the negotiations.

Indeed, the omnibus spending bill was the unfinished work of Ryan’s predecessor, John Boehner, who sealed an agreement that set the top-line budget numbers before he departed Congress at the end of October. Ryan was left to fill in the details, and most of the haggling he and Republican appropriators had to do with Democrats and the White House centered not on dollar amounts but on policy riders—restrictions in the way the government can spend the money Congress allocates. Those provisions are particularly important because in an era when relatively few bills get through Congress, omnibus spending bills are often the best—and sometimes only—opportunity for lawmakers to get their policy prerogatives into law.

“We are exercising the power of the purse,” Ryan said. “Are we exercising the power of the purse as much as I would like to? No, but that’s what you get in divided government.”

By far the biggest policy win for Republicans in the spending bill was lifting the 1970s-era ban on selling crude oil overseas. The steep drop in oil prices made that possible, and proponents said that in addition to bolstering the bottom lines of domestic energy producers, it would give the United States added foreign-policy leverage in disputes with the oil-rich nations of the Middle East. But in order to get support from Democrats concerned about promoting fossil-fuel consumption, Republicans had to give up quite a bit.

Remember all those conservative demands that Congress defund Planned Parenthood? Or their insistence that lawmakers suspend the Syrian-refugee program following the terrorist attacks in Paris? Neither of those restrictions made it into the package. Republicans also lost out in their push to block EPA regulations and funding for the Obama administration’s climate plan, although they won more modest limits on environmental policy.

Good-government groups were angered by provisions aimed at restricting the IRS’s and SEC’s ability to regulate tax-exempt organizations, which Republicans demanded in response to the IRS’s acknowledgement that it inappropriately scrutinized conservative groups in 2012. But an attempt led by Senate Majority Leader Mitch McConnell to weaken limits on spending by political parties was rebuffed.

Despite controlling both chambers of Congress, Republicans didn’t get more of their priorities in large part because of leverage held by House Democrats: Since a large bloc of conservatives won’t vote for any spending bill with a trillion-dollar price tag, Ryan knew he would have to rely on Democrats to pass it. Nancy Pelosi, the Democratic leader, demanded the extension of a series of tax credits for clean energy and for working families in exchange for consenting to lifting the ban on U.S. oil exports. As a result, the tax package enshrines several of the key provisions of President Obama’s 2009 stimulus package, including an expanded child tax credit and the refundable American Opportunity Tax Credit.

In some cases, entire new laws were attached to the spending bill. New York lawmakers—and former Daily Show host-turned-advocate Jon Stewart—won the inclusion of a permanent renewal of the World Trade Center Health Program. And privacy advocates were alarmed to see the addition of the Cybersecurity Information Sharing Act. Major provisions that had bipartisan support were the increase in medical-research funding and delays to the Obamacare taxes on so-called “Cadillac” health plans and medical devices. Those levies had drawn opposition from labor unions and many congressional Democrats, even though the White House argued that they were important cost-control parts of the Affordable Care Act.

Despite their wins, Democrats remain broadly opposed to the tax bill, which they view as too favorable to corporations and fiscally irresponsible because it adds so much to the deficit solely through revenue reduction. Pelosi called the tax package “practically an immorality,” and even after the bills were released overnight, she suggested she was still pushing for additional changes sought by Democrats.

The unspoken understanding is that while Republicans will carry the tax bill when it comes to the House floor on Thursday, Democrats will provide the bulk of the votes for the spending bill on Friday. “I do believe we will have bipartisan votes on both of these bills,” Ryan predicted. The Senate then would vote on both measures as a package on Friday. While leaders were hoping to rush the bills into law, there was still time for the agreement to blow up, and the House on Wednesday quietly passed another six-day extension of temporary government funding—just in case.