In a year of police shooting protests, historic hurricane flooding and voting rights clashes in North Carolina, it is the battle over bathrooms that could prove pivotal in the Tar Heel state's gubernatorial race.

DURHAM, NC - MAY 11: A gender neutral sign is posted outside a bathrooms at Oval Park Grill on May 11, 2016 in Durham, North Carolina. Sara D. Davis / Getty Images

The election will effectively serve as a referendum on a state law that bans transgender people from using government-run restrooms that match their gender identity and limits protections for gays and lesbians. Signed by Republican Governor Pat McCrory in March, the law has been blamed for hundreds of millions of dollars in economic losses and the relocation of major sporting events from the ninth largest U.S. state.

Opponents of the law say the vote on Tuesday also could have national implications. If McCrory loses to Democratic challenger Roy Cooper, they said, elected officials backing such measures in other states will face greater political risk.

"I believe a strong message already has been sent to lawmakers across the country," said Chad Griffin, president of the Human Rights Campaign, the nation's largest lesbian, gay, bisexual, transgender and queer (LGBTQ) civil rights organization.

"I believe and hope on Election Day that an even stronger message will be sent."

The advocacy group has joined with Equality North Carolina for a broad effort to boost voter turnout and unseat McCrory and other supporters of the law known as House Bill 2. The organizations are targeting about 400,000 pro-equality voters in the state, including an estimated 255,800 LGBT voters, Griffin said.

The Human Rights Campaign said that voting bloc could make a difference in a presidential swing state where Democrat Barack Obama won by about 14,000 votes in 2008 and Republican Mitt Romney led by about 92,000 votes in 2012.

"There’s no question this is going to be a very close race at the top of the ticket, and the LGBTQ voting bloc really has the ability to impact the outcome of this election," said Chris Sgro, executive director of Equality North Carolina.

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

RACE A TOSS-UP

Elections experts consider the race between McCrory and Cooper, one of 12 U.S. gubernatorial seats being decided on Tuesday, to be among the country's most competitive.

Public opinion polls have been tight most of the year, though the RealClearPolitics average of recent surveys shows Cooper with a slight advantage.

North Carolina Gov. Pat McCrory speaks during a candidate forum in Charlotte on June 24, 2016. Chuck Burton / AP

A Reuters/Ipsos opinion poll found that, among residents who expect to vote, 38 percent were less likely to support McCrory's re-election bid as a result of the law and its fallout, compared with 32 percent who were more likely to support him.

The poll was conducted online in English between Oct. 6 and Oct. 19. It included 1,233 likely voters and had a credibility interval, a measure of accuracy, of 3 percentage points.

Other polls have shown a majority of residents believe the law is hurting the state.

McCrory, who in 2012 became North Carolina's first Republican governor in two decades, has blamed the backlash against the law on national groups trying to redefine gender and "basic norms of privacy."

Cooper says the law is discriminatory, and he has made McCrory's support for it a central issue of his campaign.

Democratic gubernatorial candidate Attorney General Roy Cooper mingles with voters during early voting in Raleigh, N.C. Gerry Broome / AP

An ad campaign launched last week by the conservative NC Values Coalition accuses Cooper, the state's attorney general since 2001, of putting women and children at risk by refusing to defend H.B. 2.

"By not defending it, he's allowing men into women’s bathrooms," the group's executive director, Tami Fitzgerald, said in a phone interview. "We think that just goes too far."

"Equality NC and HRC have made North Carolina ground zero for their radical LGBT agenda," she added. "But I believe that their efforts will fail."

At early voting sites in North Carolina this week, the issue appeared to be galvanizing people on both sides.

"I admire McCrory for standing behind H.B. 2," said Republican Parker Umstead, 81, a certified public accountant who cast a ballot in Winston-Salem for the incumbent. "It takes courage to stand up for your beliefs."

But Holly Carpenter, a 41-year-old Republican from Cary who works in the medical field, cited the measure as the prime reason why she voted against McCrory, whom she supported in 2012.

"To lose so many economic opportunities over that was just a huge negative for me,” she said.

Follow NBC OUT on Twitter, Facebook and Instagram.