Top U.S. Senate Democrats and Republicans said on Wednesday they may have the votes to pass a bill protecting same-sex marriage rights nationwide, the day after the measure passed the House of Representatives with a bipartisan majority.

The measure, intended to head off any Supreme Court effort to roll back gay marriage rights, passed the House on Tuesday with all Democrats and 47 Republican representatives — just over a fifth of their caucus — voting in favor.

Senate Majority Leader Chuck Schumer on Wednesday said he was “really impressed by how much bipartisan support it got in the House.”

When the Supreme Court last month struck down its landmark 1973 Roe v. Wade ruling protecting the right to abortion, Justice Clarence Thomas wrote that the court should also reconsider its past rulings that guaranteed access to contraception and the right to gay marriage because they relied on the same legal arguments as Roe.

Under Senate rules, Schumer would need at least 10 Republicans in favor to pass the bill in the 50-50 Senate.

Senator John Thune, the chamber’s No. 2 Republican, said he believed a bill codifying gay marriage could receive enough Republican support to pass.

“I wouldn’t be surprised. We haven’t assessed that at all, yet,” he told reporters when asked if 10 Republicans could back such legislation. “But as a general matter, I think that is something people in the country have come to accept.”

Several other Republicans said they could support the bill. Senator Susan Collins co-sponsored a Senate version of the House bill. Senator Thom Tillis told CNN on Wednesday that he would “probably” vote in favor.

Senator Rob Portman, another co-sponsor, said the bill sends “an important message.”

Republican Senator Ted Cruz said on Saturday that the Supreme Court was “clearly wrong” in establishing a federal right to gay marriage. Senator Lindsey Graham said he would not support a bill codifying same-sex marriage.

Other Republicans said they would wait to read the text of the bill before deciding how they would vote.

Republican Senator Mitt Romney called the House legislation “unnecessary.”

“I haven’t given consideration to that legislation in part because the law isn’t changing and there’s no indication that it will,” he said, adding that Justice Thomas had “opened a lot of doors that no other justices walk through.”