WASHINGTON — Just a few years ago, the tax deal pushed through Congress on Tuesday would have been a Republican fiscal fantasy, a sweeping bill that locks in virtually all of the Bush-era tax cuts, exempts almost all estates from taxation, and enshrines the former president’s credo that dividends and capital gains should be taxed equally and gently.

But times have changed, President George W. Bush is gone, and before the bill’s final passage late Tuesday, House Republican leaders struggled all day to quell a revolt among caucus members who threatened to blow up a hard-fought compromise that they could have easily framed as a victory. Many House Republicans seemed determined to put themselves in a position to be blamed for sending the nation’s economy into a potential tailspin under the weight of automatic tax increases and spending cuts.

The latest internal party struggle on Capitol Hill surprised even Senate Republicans, who had voted overwhelmingly for a deal largely hashed out by their leader, Mitch McConnell of Kentucky. The bill passed the Senate, 89 to 8, at 2 a.m. on Tuesday, with only 5 of the chamber’s 47 Republicans voting no.

Twenty-one hours later, the same measure was opposed by 151 of the 236 Republicans voting in the House. It was further proof that House Republicans are a new breed, less enamored of tax cuts per se than they are driven to shrink government through steep spending cuts. Protecting nearly 99 percent of the nation’s households from an income tax increase was not enough if taxes rose on some and government spending was untouched.