The Senate passed Republicans’ budget plan early Friday on a largely party-line vote.

The final tally was 52-48, with all Democrats and one Republican, Rand Paul of Kentucky, opposing the resolution.

Senators spent most of the night on a well-worn parliamentary ritual: the hourslong marathon of votes on proposals that will never become law (and were never intended to) known as a “vote-a-rama.” In a chamber where the average age is 65, the all-nighter brought senators to the floor for a binge of procedural motions and floor speeches delivered to a mostly empty chamber that served to frame a feud between Republicans and Democrats over the nation’s priorities and how federal money should be spent.

As senators slowly made their way into the chamber late Thursday afternoon, it was clear that Washington was in for a long night. Aides hauled thick briefing folders in one hand and caffeinated beverages in another.

Republicans were there to make the case for their budget resolution, which must be adopted to allow them to push through President Trump’s ambitious agenda. Democrats came primed to build their public case against Mr. Trump’s plans, and begin laying the groundwork to exact a political price from Republicans for supporting them.

“This is going to be a long, drawn-out fight,” Senator Chuck Schumer, Democrat of New York and the minority leader, said as members of his party lined up to offer amendments to fight Mr. Trump’s fiscal agenda. “Democrats are going to hold the floor all day long and all night long to expose how Republicans want to cut taxes for billionaires while gutting things Americans care about most.”

Passing a budget resolution was a key step toward enacting Mr. Trump’s fiscal agenda, a process that has been complicated by competing strategies among House and Senate Republicans about the best way to accomplish the president’s priorities.

“People are counting on us,” Senator Lindsey Graham, Republican of South Carolina and the chairman of the Budget Committee, declared on the floor moments before the rally of votes began. “They’re counting on this Republican majority to give the president the money he needs to do the job that he promised to do, and we’re going to deliver.”

“If it’s 5 o’clock in the morning — I don’t care how long it takes,” Mr. Graham added. In the end, it did take until nearly 5 a.m.

For Democrats, who did not have enough votes to block Republicans’ budget, the vote-a-rama was a way to slow its roll, challenge G.O.P. priorities and, when possible, force Republicans into uncomfortable votes intended to create a damaging record to attack them on during next year’s midterm elections. The rules of the Senate allow members to propose an unlimited number of budget amendments, meaning voting could continue until Democrats lost steam and allowed the debate to come to a close.

Their first attempt to box in G.O.P. senators came in the form of a proposal that would bar tax cuts for any person making more than $1 billion a year. It was meant to drive home Democrats’ argument that Republicans want to slash spending for ordinary Americans just to reward billionaires with tax cuts.

“I ask my Republican colleagues: Yes or no? Do you believe billionaires should get another tax break or not?” Mr. Schumer said as he introduced the proposal. It failed nearly entirely along party lines, setting the tone for a night when Democrats were not expected to prevail in making any substantive change to the budget blueprint.

As the night wore on, Democrats offered up similar proposals to protect food pricing and Medicaid funding.

Most of the votes played out along partisan lines, but some Republicans broke with their party to back Democratic proposals.

Two Republican senators broke ranks on multiple occasions during the night. Senator Susan Collins of Maine backed two Democratic proposals aimed at blocking tax cuts for the superrich, while both she and Senator Josh Hawley of Missouri supported a measure to protect Medicaid funding for maternal health care. Mr. Hawley also voted in favor of an amendment seeking to curb the influence of hedge funds in the single-family housing market.

Despite those defections, the amendments failed. Still, Ms. Collins’s and Mr. Hawley’s votes could serve as political insulation down the line, allowing them to claim independence from party orthodoxy when it proves useful.