For Republicans, the hourslong ritual of the vote-a-rama served as a last-ditch effort to inflict political pain over a package they have no intention of supporting.
They railed against the hundreds of billions of dollars in climate spending, tried to siphon funds toward restricting immigration at the southwestern border and repeatedly attacked a $80 billion plan to beef up tax enforcement at the I.R.S.
It also became an opportunity to encourage those watching on C-SPAN, however few, to back Republicans in November.
“If you’re tired of paying high gas prices, then vote Republican,” Senator Lindsey Graham, Republican of South Carolina, concluded after pushing back against one amendment.
While Democrats beat back most of the Republican amendments over nearly 16 hours, they used a tricky procedural maneuver in some cases that allowed a few Democrats to vote in favor of changes that could help them politically without endangering passage of the final bill. For example, Senator Raphael Warnock of Georgia, who is up for re-election in November, proposed a change to close the Medicaid gap in his state. Because Democrats set the bar for passage of the measure at 60 votes, Mr. Warnock could vote yes without any chance the amendment would be adopted.
One Republican challenge has prevailed: a move to strip a $35 insulin cap for private insurers as a violation of the strict rules governing the process. An effort to preserve that proposal fell short of the 60-vote threshold. And in the final hours of the vote-a-rama early Sunday afternoon, seven Democrats joined all Republicans in narrowing the scope of the 15 percent corporate minimum tax.
While Republicans proposed most of the amendments, Senator Bernie Sanders of Vermont, an independent who caucuses with Democrats, tried to push the bill in a progressive direction and recapture some of the policy items in Mr. Biden’s initial package that had been cut during negotiations.
Mr. Sanders forced a series of votes that included a cap on the costs of prescription drugs, extending the child care tax credit and establishing a civilian climate corps.
But his amendments failed by large margins: 1-99, 1-98 or 1-97. Many Democrats had pledged before the vote-a-rama to stick together as a voting bloc to preserve the delicate coalition of progressives and centrists brought together to support the legislation. The amendment votes put his colleagues in an uncomfortable position.
“Come on, Bernie,” Senator Sherrod Brown of Ohio could be heard muttering after he explained that he would oppose the inclusion of expanded payments to most families with children — a policy he has long championed — to protect the broader deal.
Mr. Sanders said he felt he had to push for the policies because Democrats could lose control of Congress in the midterm elections.
“We don’t know what the election results will be,” he said. “This could be actually the very last time in a long time that people are going to have the opportunity to vote on child tax care credit.”
Stephanie Lai contributed reporting.