Breaking the vote down by party, Republicans were split 169-62, while Democrats divided themselves 163-32.

The vote was a difficult one for many members.

For some Republicans, the bill didn’t cut deeply enough or go far enough to mirror the types of changes that conservatives heralded in Ryan’s signature House-passed budget blueprints.

They also had to contend with the chorus of calls to oppose the deal from influential outside conservative advocacy groups, such as Heritage Action for America, the Club for Growth and Americans for Prosperity.

For some Democrats, it was difficult to get beyond the fact that the deal didn’t create new revenue through tax increases, and that it was not tied to an extension of emergency unemployment insurance aid, set to expire before the end of the year.

But enough lawmakers from both parties held their noses as Ryan counseled “not to let the perfect be the enemy of the good,” and Minority Leader Nancy Pelosi, D-Calif., urged her caucus to “embrace the suck” of the agreement.

The plan sets a $1.012 trillion discretionary spending level for 2013 — halfway between the $967 billion sequester level and the far-higher number Democrats were seeking. It also sets a $1.014 trillion for 2014. It finds savings through recalculating federal workforce pensions and requiring government employees to contribute more toward retirement, something Democrats were sour on as well.

The Senate is expected to take up the measure next week, when the chamber will still be in session. The House is set to adjourn on Friday and will return in early January.