The House on Tuesday approved a $1.4 trillion spending package that would stave off a looming shutdown and fund the federal government through September, acting in a burst of bipartisanship just a day before Democrats plan to impeach President Trump.

The legislation would also remove three controversial taxes from the Affordable Care Act, the 2010 law that was a top legislative achievement of President Barack Obama.

The package passed in two pieces, one focused on GOP national security priorities including the Pentagon, the other on domestic agencies dear to Democrats such as the Department of Health and Human Services. The vote on the national security package was 280 to 138. The vote on the domestic agencies was 297 to 120.

The year-end legislative frenzy, which came ahead of the divisive impeachment vote in the House, showed how far both parties have moved since last year, when a spending fight led to a 35-day government shutdown. This time, both parties reverted to a hallowed congressional tradition of embracing an enormous year-end spending bill. Each side made concessions to secure long-sought funding.

The legislation would add almost $50 billion in new spending, even though the White House and Republicans called for major budget reductions earlier in the year. The package would also strip back parts of the ACA, legislation that many Democrats say serves as a defining moment of the Obama administration. The ACA taxes that were cut, however, were controversial, and even many Democrats opposed them.

All told, the legislation could add more than $500 billion to deficits over the next decade. The deficit — or annual gap between government spending and tax revenue — is expected to eclipse $1 trillion this year and grow in subsequent years unless changes are made.

The spending binge generated predictable finger-pointing, with Republicans defending their demands for increased Pentagon budgets while accusing Democrats of profligacy in funding domestic agencies. Democrats argued the reverse, contending that more money for health and education programs was justified and blaming Republicans for making defense spending the price to pay. Few if any voices could be heard defending Congress’ overall addiction to growing the federal budget, and with it the nation’s debt, which now exceeds $23 trillion.

“I joined the Appropriations Committee because it is the best place to give more people a better chance at a better life,” Appropriations Chairwoman Nita M. Lowey (D-N.Y.) said as she celebrated bigger budgets for Head Start, the National Institutes of Health, the Environmental Protection Agency and more. “With this bill, we have lived up to that promise by making historic investments for the people.”

The legislation includes some grab-bag provisions. It would raise the age of tobacco purchases to 21, provide funding for gun research, boost funding for the census, and stabilize pensions for tens of thousands of miners who were on the verge of losing their benefits.

The legislation also extends dozens of tax credits and incentives for biodiesel producers, brewers, distillers and others.

“The list goes on and on,” said Senate Majority Leader Mitch McConnell (R-Ky.), as he urged support for the legislation when it comes to the Senate floor later this week. He also praised the process of both sides accepting concessions to secure a spending deal.

The nonprofit Committee for a Responsible Federal Budget chided Congress for embracing what it termed “zombie tax extenders,” which it said would add more than $400 billion to the debt over the next decade. This is a reference to tax cuts that are designed to be short term but end up being extended repeatedly. When the House passed the legislation Tuesday, committee President Maya MacGuineas wrote on Twitter, “What a bucket of garbage this bill is.”

The legislation will fund the government through Sept. 30, shortly before the presidential election.

Last year, a similar effort to pass a December spending bill fell apart when Trump demanded money for a border wall. There was little appetite to repeat that impasse, though the White House did request $8.6 billion in new spending for the barrier.

Democrats refused and kept border barrier funding levels at $1.375 billion. White House officials did not signal that Trump planned to object, noting that the administration retained flexibility to move money from other accounts if necessary, as it attempted to do earlier this year. The extent of those powers is unclear, though. Last week, a federal judge said the White House did not have the authority to redirect military construction money and use it for the border wall. The case could remain in court for some time.

The tax and spending package now moves to the Senate, which must act before midnight on Friday. That’s when existing funding for government agencies is set to expire.

In a further burst of bipartisanship, the House Ways and Means Committee voted overwhelmingly to approve the North American trade deal that was finalized between House Democrats and the Trump administration last week. The full House is expected to approve it Thursday.

Like the trade bill, the spending package includes provisions for both parties to celebrate. Democrats pointed to $25 million in funding for gun violence research, $425 million in election security grants, and a boost in funding for the EPA.

The funding for gun violence research would be the first of its kind in 20 years. Other Democratic priorities included in the bill are a 3.1 percent pay raise for civilian federal employees, $7.6 billion in funding for the 2020 Census and record funding for education programs including Head Start.

Approval of the pay raise, which would be the largest since 2009, ends a year of back-and-forth over a boost for federal workers. Trump initially recommended no raise but then in late summer backed a 2.6 percent increase to be paid across the board.

Also included in the spending legislation is a bill raising the national age for tobacco sales to 21, a priority for McConnell. And it permanently repeals ACA levies on medical devices and high-cost employer-provided insurance plans, as well as an annual fee on insurance providers, all of which had faced bipartisan opposition since the law’s passage. Although the tax on “Cadillac” insurance plans had never even taken effect, repealing the taxes will deprive the Treasury of more than $370 billion over 10 years, according to the Congressional Budget Office.

Republicans highlighted a $22 billion increase in Pentagon funding, which Democrats agreed to over the summer as part of a two-year, $2.7 trillion budget accord that also suspended the federal debt cap for the remainder of Trump’s first term.

Other GOP wins included funding to advance a Veterans Affairs program aimed at privatizing some health-care delivery, as well as the preservation of several policy restrictions related to abortion and gun rights.

The legislation, for instance, does not contain Democratic language overturning the Trump administration’s move to bar organizations that receive federal family-planning grants from referring patients for abortions. It also leaves out increased funding of foreign family-planning programs that Republicans have said encourage abortions.