WASHINGTON — The Senate pushed a major antibias gay rights bill past a first hurdle Monday, a sign of Americans’ greater acceptance of homosexuality nearly two decades after lawmakers narrowly rejected similar legislation.
By a vote of 61 to 30, one more than necessary, the Senate agreed to move ahead on the bill that would prohibit workplace discrimination against gay, bisexual, and transgender Americans.
Lawmakers could pass the bill by week’s end, but its prospects in the Republican-majority House are dimmer.
In high drama for the Senate, the typical 15-minute vote stretched beyond 30 minutes of waiting and cajoling.
Two backers of the measure — Senators Claire McCaskill of Missouri and Lisa Murkowski of Alaska — were on planes back to Washington.
That left sponsors stuck at 58 of the necessary 60 votes, forcing Senators Susan Collins, Republican of Maine, and Jeff Merkley, Democrat of Oregon, to lobby fiercely, sometimes at the door of the Republican cloakroom off the Senate floor.
Minutes into the vote, Senator Kelly Ayotte of New Hampshire emerged to vote yes.
Then the outcome rested with Senator Rob Portman of Ohio, who announced earlier this year that his son was gay and he supported same-sex marriage, and Senator Pat Toomey of Pennsylvania.
After extended discussions, Portman and Toomey emerged to vote yes.
‘‘I have long believed that more legal protections are appropriate to prevent employment discrimination based on sexual orientation,’’ Toomey said in a statement after the vote, in which he promised to offer an amendment to protect religious freedom.
The vote reflected both the nation’s changing views and lingering resistance to homosexuality.
The political implications resonated in Maine, as six-term Representative Mike Michaud, a Democrat who is seeking to unseat incumbent Governor Paul LePage next year, revealed he was gay and questioned whether it still mattered to voters.
Hours before Monday’s vote, President Obama issued a fresh plea for passage of the Employment Non-Discrimination Act, the first significant gay rights bill since Congress lifted the ban on gays serving openly in the military three years ago.
‘‘Americans ought to be judged by one thing only in their workplaces: their ability to get their jobs done,’’ the president said in a message written for Huffingtonpost.com. ‘‘Does it make a difference if the firefighter who rescues you is gay — or the accountant who does your taxes or the mechanic who fixes your car?’’
Seven Republicans joined the members of the Democratic majority who voted for the measure.
The three potential Republican presidential candidates — Marco Rubio of Florida, Ted Cruz of Texas, and Rand Paul of Kentucky — voted against.
Senator Dean Heller, a Nevada Republican, announced his support on Monday, saying the measure ‘‘raises the federal standards to match what we have come to expect in Nevada, which is that discrimination must not be tolerated under any circumstance.’’
Federal law prohibits discrimination on the basis of sex, race and national origin. But it doesn’t stop an employer from firing or refusing to hire workers because they are gay, lesbian, bisexual or transgender.