BATAVIA, N.Y. — Last time around, Nate McMurray seemed to have everything going his way.
The man he was trying to unseat, Representative Chris Collins, was hit with federal insider trading charges three months before the 2018 general election. Mr. Collins, a Republican, temporarily suspended his campaign; even when he resumed, he raised little money and made few public appearances in the district in Western New York.
Despite those advantages, Mr. McMurray, a Democrat, fell short, losing by less than 1,100 votes. The result underscored Mr. McMurray’s challenge, then and now.
The 27th Congressional District is about as Republican as New York, a deep blue state, can get. Donald Trump carried the district by some 25 points in 2016, and Mr. Collins had been one of the president’s earliest and most ardent supporters.
Mr. McMurray is back to try again — and will face state senator Chris Jacobs, the Republican candidate, in a race that is potentially a harbinger of the electoral mood ahead of November’s presidential election.
Despite the long odds, Mr. McMurray, a lawyer and former town supervisor in Grand Island, N.Y., northwest of Buffalo, has been buoyed by what he sees as concern in some Republican ranks: Last week, the president’s son, Donald Trump Jr., recorded a robocall for Mr. Jacobs, a move that came on the heels of an endorsement on Twitter from the president himself.
The backing from the Trumps — and Mr. Jacobs’s embrace of the president — is somewhat striking considering that fellow Republicans regularly criticized the senator as too moderate in the past.
Now, however, Mr. Jacobs seems to be banking on the president’s appeal and Mr. McMurray’s disdain for him.
“It’s clear that Nate hates Trump,” Mr. Jacobs said, adding, “The majority of the voters in this district support Trump.”
Indeed, on one point, at least, Mr. Jacobs and Mr. McMurray seem to agree: 2020 will be a referendum on the president.
“A win would be a punch in the eye to Trumpism,” said Mr. McMurray. “A close loss would be the same.”
But if Democratic Party leaders think the contest has added significance, they are not acting that way: The Democratic Congressional Campaign Committee, for instance, has done little to support Mr. McMurray’s campaign.
“They’re terrible,” Mr. McMurray said. adding that if he had more help from Democratic leadership in 2018 — or now — he’d win “in a landslide.”
Robyn Patterson, a spokeswoman for the D.C.C.C., didn’t comment directly on Mr. McMurray’s remarks, but noted the circumstances of Mr. Collins’s departure and said, “House Democrats are on offense in races across the country.”
Mr. Jacobs, a scion of a wealthy Buffalo family, earned the Republican nomination in late January after being endorsed by eight county chairs in the district, an anvil-shaped chunk of suburban and rural towns between Buffalo and Rochester.
The special election is for the remainder of Mr. Collins’s term, which ends this year; the seat will be contested again in November for a full two-year term.
In a peculiar wrinkle, Mr. Jacobs is not only running against Mr. McMurray in the special election; he is also simultaneously running in the Republican primary against two challengers — Beth Parlato and Stefan Mychajliw Jr. — on Tuesday.
It is theoretically possible for Mr. Jacobs to defeat Mr. McMurray but lose in the Republican primary — meaning that he could represent the district for the remainder of this year, but then have to defend his seat in November, running against the Republican nominee on the ballot line of the Independence Party, which also nominated Mr. Jacobs.
Mr. McMurray also plans to run in November on the Democratic line, setting up an almost inevitable sequel to the current campaign, regardless of who wins on Tuesday.
In another peculiarity, Mr. McMurray — a former Fulbright scholar who worked as a lawyer in Asia for nearly a decade — had worked for more than five years in a high-ranking business development position at Delaware North, the casino and hospitality company, which was co-founded by Mr. Jacobs’s grandfather.
Mr. McMurray says that he was placed on unpaid leave by the company after it became clear that he was running for Congress against Mr. Jacobs. Mr. Jacobs denied this, saying he has nothing to do with Delaware North.
“I think its reasonable to say if you want to run for Congress, you should take a leave of absence,” Mr. Jacobs said. “But that’s all I know.”
Like campaigns nationwide, the race in the 27th has been complicated by the coronavirus outbreak and intensified by the civil unrest that erupted following the George Floyd killing on Memorial Day.
Mr. Jacobs, who cuts a quieter, more subdued figure than Mr. McMurray, is in his second term representing a district comprising a number of Buffalo suburbs, after a stint as county clerk in Erie County. He dismisses the notion of an upset, saying that Mr. McMurray is wildly out of step with the mores and mood of the 27th.
“His politics are wrong for this district,” said Mr. Jacobs, who is 53, married, with a toddler at home. “He is very liberal. He is for much more of a socialist America. And this district does not align with that.”
He added: “I think that he’d be much more appropriate running in Manhattan.”
Nick Langworthy, the chairman of the state Republican Party, echoed this, calling Mr. McMurray “all in with the radical left for socialism, anarchy and open borders.”
“The last thing voters want is a rubber-stamp acolyte of Nancy Pelosi and A.O.C.,” he said, referring to the House speaker and Representative Alexandria Ocasio-Cortez, two Democrats who have not always agreed on policy and messaging.
Mr. McMurray, 45, does support many of the policies embraced by the progressive wing of the Democratic Party but said his logic for doing so is less about hewing a liberal line and more about practical concerns.
“I’ve only thought about what would help my family,” said Mr. McMurray, who is married with two children. “Do I think that health care for every single American is something that’s going to help me win? I don’t know. But I know it would help my family and my neighborhood. So if other people classify these positions as too left, that’s their problem.”
In late March, Gov. Andrew M. Cuomo moved the election from April 28, lengthening the campaign by two months; he later increased access to absentee voting by mail, which Mr. McMurray believes boosted his chances. Early voting began June 13; his campaign asserted that many absentee and other early-voting ballots have been cast by Democratic voters.
The district’s demographics undoubtedly favor Mr. Jacobs: There are about 40,000 more Republicans than Democrats, as well nearly 14,000 Conservative Party members, who generally vote for Republicans.
For farmers like Doug Tillotson, the pressing issues of this election are immigration, which is vital to supply agricultural labor, as well as crop subsidies.
“We don’t look for a handout, though we have to take it,” said Mr. Tillotson, one of a handful of people attending an event for Jacobs at Hi-Land Farms, a family-run dairy farm in Wyoming, N.Y. “I just hope he can see the plight of different people in New York.”
At a recent rally in Batavia, however, Mr. McMurray’s supporters were more vocal, chanting the candidate’s name through protective masks and waving campaign signs.
“We’ve had a bad streak of Chrises running for the Republicans,” said Michael Plitt, the Genesee County Democratic chairman, mentioning Mr. Collins, Mr. Jacobs and another local congressman, Chris Lee, who resigned in 2011 after sending a shirtless photo to a woman who was not his wife. “We need someone different: Nate.”
All told, about 50 people circled around as Mr. McMurray, wearing work boots, jeans and a dark plaid shirt, strode back and forth promising a victory on June 23.
“We can’t be timid, this is not a time for timidness,” he said. “Our country is at a crossroads, right? We’re at a crossroads. And if we don’t change things, it’s going to get worse.”