In the end, 12 Republicans voted for the measure: Senators Roy Blunt of Missouri; Richard M. Burr and Thom Tillis, both of North Carolina; Shelley Moore Capito of West Virginia; Ms. Collins; Joni Ernst of Iowa; Ms. Lummis; Lisa Murkowski and Dan Sullivan, both of Alaska; Rob Portman of Ohio; Mitt Romney of Utah; and Todd Young of Indiana.
Republican Senators Ben Sasse of Nebraska and Patrick J. Toomey of Pennsylvania — both of whom are retiring — did not vote, nor did Senator Raphael Warnock, Democrat of Georgia, who is still campaigning for re-election ahead of a Dec. 6 runoff.
After the bill passed the House over the summer, momentum on legislation flagged in September after Senate Democrats moved forward instead with the Inflation Reduction Act and put the marriage bill on hold until after the midterm elections, bowing to the request of Ms. Baldwin, who believed she would have more success attracting votes from Republicans after the balloting.
That calculation rankled some progressive Democrats, who said Republicans should have to answer to voters for their positions on the bill. Delaying it, for instance, spared Senator Marco Rubio of Florida and Senator Ron Johnson of Wisconsin, both of whom were up for re-election this year, a tough choice between embracing a measure that could anger their conservative base and opposing it, potentially alienating independent and moderate voters.
But Ms. Baldwin’s calculation paid off; the week after the election, the measure had more than enough Republican supporters to move forward.
That was in large part because of changes made during bipartisan negotiations, in which senators agreed to add the language ensuring that churches, universities and other nonprofit religious organizations could not be punished for declining to recognize same-sex marriages. They also added language to make clear that the bill does not require or authorize the federal government to recognize polygamous marriages.
The push to pass the legislation began over the summer, after Justice Clarence Thomas suggested in his opinion in the ruling that overturned Roe v. Wade, which had established a constitutional right to abortion, that the court also “should reconsider” precedents enshrining marriage equality and access to contraception.