Senate Armed Services Committee Chairman John McCain (R-Ariz.) faces a tough re-election fight this year. (Photo by Chip Somodevilla/Getty Images)

The Republican senator who once campaigned against gays serving openly in the military is now the civil rights community’s greatest bulwark against undoing LGBT protections in this year’s defense policy bill.

Democrats and LGBT rights advocates will be keeping a close eye on Senate Armed Services Committee Chairman John McCain (R-Ariz.) during upcoming negotiations on the defense measure. House and Senate leaders could clash over language concerning whether religious organizations with federal contracts should be exempt from nondiscrimination orders covering gender identity and sexual orientation.

[Paul Ryan is in another fight he doesn’t want over LGBT rights]

The shooting incident Sunday that killed 50 people in a popular Orlando gay bar and dance club will only increase the attention on how Congress deals with LGBT issues and could have a big impact on defense bill negotiations,

McCain, unlike House Republicans, wrote a defense bill that seeks no special nondiscrimination exemptions for religious groups, a move that has the support of Democrats and LGBT groups. McCain has also steered the Senate debate clear, so far, of the tensions in the House, where Republican leaders’ maneuvered to prioritize exemptions for religious groups over LGBT nondiscrimination protections.

But how the House and Senate resolve their differences over the issue remains unclear and McCain’s opponents will likely not give him much wiggle room to compromise over these issues on the campaign trail, where the GOP’s most influential congressional voice on military matters is facing a fierce challenge from Democrat Ann Kirkpatrick.

“In Arizona, independent voters are key to winning reelection. . . and this is a good swing issue,” said Human Rights Campaign political director David Stacy. “[McCain] could be the decider here.”

As of last week, McCain did not appear to be feeling much political pressure, suggesting that LGBT rights and whether women should be subject to the draft are not likely to be a big source of contention during negotiations with the House.

[Ryan moves to prevent another floor fight over LGBT rights]

On Sunday, McCain issued a statement extending condolences to the families of the victims.

“As we learn more information about this tragedy, we must remain steadfast in our commitment as a nation to acknowledge the threats we face and do everything we can to root out terror,” he said.

The Obama administration has already threatened to veto both the House and Senate defense bills over several provisions, including the complaint that the House bill “would make it easier to discriminate on the basis of sexual orientation.”

McCain has not traditionally been a standard-bearer for better integration of women and lesbian, gay, bisexual and transgender individuals in the military.

Six years ago, McCain led the Senate opposition to a repeal of the military’s “Don’t Ask, Don’t Tell” policy preventing gays and lesbians from serving openly in the military, a provision that was tucked into that year’s defense policy bill. He never reacted warmly to President Obama’s plans to open all combat roles to women, and he has been similarly circumspect about plans to allow transgender troops to serve openly.

But over the same period, McCain also stepped forward as one of the few Republicans willing to vote for legislation preventing employment discrimination on the basis of sexual orientation or gender identity, and he spoke out against a bill in Arizona to allow businesses citing religious beliefs to deny service to gays and lesbians.

He was also one of the first senators to call for including women in a potential draft, once combat roles were opened to women – a provision he incorporated into the Senate’s version of the defense policy bill.

Democrats are now looking to McCain to hold the line against efforts from House Republicans to keep their language on LGBT people and the draft in the final bill.

“That would be a flip that we would take advantage of, absolutely. Because to go from being fair to swallowing your words, in this campaign, I think would be hard,” said Rep. Raúl M. Grijalva (D-Ariz.) “It would leave an opening for Kirkpatrick to just call him on the hypocrisy.”

Even before Sunday’s shooting, Kirkpatrick had lobbed terms such as “shameful” and “cowardly” at the House GOP for their efforts to block measures guaranteeing nondiscrimination for LGBT federal workers.

While Arizona is widely considered a red state, conservative ideology does not always dominate public opinion when it comes to social issues.

Polling done last year by the Public Religion Research Institute shows a majority of Arizona residents favored nondiscrimination laws on sexual orientation and gender identity and opposed religious exemptions from such laws.

Even conservative Republicans acknowledge that the political climate in Arizona makes it difficult for McCain to acquiesce to the House’s take on social issues during a close election.

“I’m afraid that the elections and the fear of them has a profound influence on the committee,” said Rep. Trent Franks (R-Ariz.).

The calendar could save Republicans from an inconveniently-timed fight over contentious social policy language in the final bill.

Once the Senate passes its version of the defense bill later this month, it will be working against the clock: With only a few legislative days in July, it is unlikely that lawmakers finish negotiations on the defense bill before the August recess and McCain’s August primary. Then Congress spends just a few weeks in Washington in September before jetting off for the election.

In years past, this schedule has delayed final votes on the defense bill until well into the post-election lame duck period.

But activists do not plan to wait for the negotiations process to finish before pressuring lawmakers to commit to a position on these social issues.

“Absolutely we are going to hold members accountable; we are going to make sure their constituents know how they voted,” said Stacy, adding that “if this is still pending over the course of the August recess, we have a lot of independent lobbying we’ll be doing then.”