The Associated Press reports that House Republicans sweated out a victory on a major budget cut bill in the wee hours Friday, salvaging a major pillar of their agenda despite divisions within the party and nervousness among moderates that the vote could cost them in next year’s elections.

The bill, passed 217-215 after a 25-minute-long roll call, makes modest but politically painful cuts across an array of programs for the poor, students and farmers.