Mormons, reflecting shifting attitudes inside their church, have stepped in to provide the political muscle, the additional momentum or the decisive vote. And more often than not, they were not just Mormons, but Republicans.

The bill, which passed by a vote of 64 to 32 with 10 Republicans joining, was a priority of Senator Harry Reid, the majority leader, who, as the Mormon Church’s highest-ranking member in the government, put the nondiscrimination measure at the top of the Senate’s agenda once the government reopened last month. “People shouldn’t be able to fire them because of their sexual orientation any more than you can fire them if they’re Mormon,” Mr. Reid said Thursday in an interview.

Senator Orrin Hatch of Utah, who at 79 is one of the Senate’s longest-serving members, became the first Republican to signal he would reverse his opposition as the bill faced a crucial vote in committee. He voted against a similar bill the last time it came up in the Senate — 17 years ago — but changed his mind earlier this year after Gordon H. Smith, a fellow Mormon and former Republican senator, convinced him there was nothing in it that violated church doctrine. “The church does want to be helpful where we can be, without violating our own conscience,” Mr. Smith, a former bishop, said in an interview.