WASHINGTON — Reflecting Americans’ increasing acceptance of gays, the Senate on Thursday approved legislation that would bar workplace discrimination based on sexual orientation and gender identity.

Gay rights advocates hailed the bipartisan, 64-32 vote as historic although it could prove short-lived. Speaker John Boehner, R-Ohio, has signaled that the Republican-led House is unlikely to even vote.

Seventeen years after a similar measure failed by one vote, 54 members of the Senate Democratic majority and 10 Republicans voted for the Employment Non-Discrimination Act. It is the first major gay rights bill since Congress repealed the ban on gays serving openly in the military three years ago.

“All Americans deserve a fair opportunity to pursue the American dream,” said Sen. Susan Collins, R-Maine, a chief sponsor of the bill.

Proponents cast the effort as Congress following the lead of business and localities as some 90 percent of Fortune 500 companies and 22 states have outlawed employment discrimination against gay, bisexual and transgender Americans.

Supporters described it as the final step in a long congressional fight against discrimination, coming nearly 50 years after enactment of the Civil Rights Act and 23 years after the Americans with Disabilities Act.

“Now we’ve finished the trilogy,” said Sen. Tom Harkin, D-Iowa, a chief sponsor of the disabilities law, at a Capitol Hill news conference.

Two Republican senators who voted against anti-discrimination legislation in 1996, Arizona’s John McCain and Orrin Hatch of Utah, backed the measure this time. Alaska Republican Sen. Lisa Murkowski voted in favor; her father, Frank, opposed a similar bill nearly two decades ago, underscoring the generational shift.