“I’m a Lincoln guy,” said Norm Coleman, a Republican former senator from Minnesota who is lobbying for the bill, known as the Employment Nondiscrimination Act. “So if you go back to who we are, what we are about as a party — economic freedom, equality, the right to earn a living — this makes sense.”

Democrats are confident they will have a good outcome regardless of the final vote, and have pressed ahead despite not being absolutely certain that the bill can pass. If they succeed, it will be the first time the Senate has passed an anti-discrimination bill that protects gay men and lesbians. One failed in 1996, the last time the issue came to a vote on the floor.

And if it fails this time, Democrats will be able to frame the loss as a victory by Republican extremists.

“How can they justify voting against it?” said Barney Frank, who tried to get a nondiscrimination bill passed when he was a Democratic congressman from Massachusetts.

When Mr. Frank pushed the bill through the House in 2007 — it would go nowhere in the Senate that year — he had to drop the transgender provision. “Unfortunately, in 2007 we still had the ‘ick’ factor when people were confronted with transgender,” recalled Mr. Frank, one of only a few openly gay or lesbian members of the House at the time.

Senator Susan Collins, a Maine Republican who has led the effort in the Senate to persuade more Republicans to vote for the bill, said some colleagues had raised concerns about how transgender people would have to be accommodated, including one who was concerned about insurance covering sex changes. But by and large, she said, she came away from conversations encouraged that many Republicans seemed to be willing to re-evaluate their views on sexual orientation, gender identity and the law.

“Generally, what I’ve found is a real openness to taking a second look at this issue,” Ms. Collins said. “I’ve lobbied issues where people don’t return your calls, or they try to duck you because they don’t want to discuss it. That has not been my experience at all” with this bill, she added.