ROCHESTER, N.Y. — It did not take long for President Trump to wade into the civil unrest that seized the city over the death of Daniel Prude, a Black man who died of suffocation after Rochester police officers placed a hood over his head.
Mr. Trump likened a peaceful march in Rochester to the clashes in Portland, Ore., saying earlier this month on Twitter that the two cities had “bad nights.” The next day, the president incorrectly asserted that “most of the police in Rochester, N.Y., have resigned,” blaming “the Democrat Mayor and, of courses, Governor Cuomo.”
The president’s incursions in Rochester have divided Republicans in Western New York, as candidates vying for Congress and local office weigh whether to embrace Mr. Trump or distance themselves from his characterization of the Black Lives Matter movement as “a symbol of hate.”
Nowhere is that dynamic more pronounced than in heavily Democratic districts like Monroe County, which includes Rochester, the state’s third-largest city, where Republicans running as moderates risk alienating voters by adopting the president’s antagonistic view of protesters.
George Mitris, a Republican facing an uphill battle to unseat Representative Joseph D. Morelle, a Democratic fixture in the region, has openly disagreed with the president’s comments on Twitter, and embraced the Black Lives Matter movement in his platform.
Mr. Mitris, as well as some Republicans in Rochester running for the State Legislature, have declined to say whether they would vote for Mr. Trump in November, instead focusing their campaigns on local issues and pitching themselves as unifiers above partisan politics.
“I worship no man,” said Mr. Mitris, a lawyer running for office for the first time. “I’m really not focused on the president at all, to be quite honest. I’m focused on the people of this community.”
That dynamic is reversed in the 27th Congressional District, a conservative region sandwiched between Rochester and Buffalo, where an insurgent Democrat, Nate McMurray, has been trying to link Representative Chris Jacobs to the president for months, including during the campaign for a special election in June that ended with Mr. Jacobs’s victory.
The two men are opposing each other again in November, and Mr. McMurray said he hoped that the attention paid to police brutality in Rochester will motivate liberal voters in the district, particularly “young people who are harder to get out to the polls.”
Even so, Mr. McMurray, a Democrat and former town supervisor in Grand Island, N.Y., northwest of Buffalo, seems aware of the conservative bent of his district, saying that while he believes in systemic change, he doesn’t “want to defund the police.”
“But I want to make sure the police themselves are proud of the work they’re doing and are not tainted by these terrible events that continue to happen,” he said.
Mr. Jacobs, a scion of a prominent and wealthy Buffalo family, won in June running on a pro-Trump platform — garnering an endorsement from the president and a campaign robocall from the president’s son Donald Trump Jr. — and has remained firmly in that camp.
His Twitter campaign account prominently features a photo of Mr. Trump, and its bio describes Mr. Jacobs simply as the “Trump Endorsed Candidate for New York’s 27th Congressional District.”
“Daniel Prude’s death was an unspeakable tragedy, and I believe everyone involved wishes it did not happen,” Mr. Jacobs said in a statement, adding that while he fully supported the rights of those who wish to peacefully protest, “the recent violence we’ve seen in the streets is unacceptable.”
“There is no place for this lawlessness in America,” Mr. Jacobs continued. “The residents of NY-27 are fed up with the violent riots and support a return to civility.”
Nick Langworthy, the chairman of the state Republican Party and a longtime resident of Western New York, said that he believed that the unrest in Rochester had played in his party’s favor, with voters from across the political spectrum concerned about “safety and security.”
He argued that the law-and-order message dovetailed with arguments made earlier this year — long before the Black Lives Matter movement gained new momentum — that New York’s recently reformed bail laws were endangering public safety.
“Voters are intelligent: They understand that there’s a cause and effect, and the cause of this is largely the revolving-door criminal justice policies that have been brought to us in the last year,” he said.
He added that he believed that “outside agitators” caused “the worst actions” in protests in Buffalo and Rochester.
“When you have those people that are willing to create mayhem and you can’t hold them, you know, they’re going to continue to perpetuate the situation,” Mr. Langworthy said. “And it’s a contagious situation.”
Republicans say they are confident their focus on New York’s high taxes and their law-and-order message are also resonating with voters, echoing refrains from President Trump.
In the State Senate, which Democrats control by a healthy margin, Republicans have already poured thousands of dollars into digital ads criticizing Democrats’ positions on law enforcement.
In early September, shortly after protesters hit the streets over Mr. Prude’s death, Republicans pushed an ominous video on Facebook attacking Samra Brouk, a Democrat running for a State Senate seat that includes parts of Rochester, for her stance on policing.
The video, dark and gloomy, shows a scared woman calling 911 from her bedroom in the middle of the night to report an apparent break-in. Then, a message: “When your family is in danger, you need the police to pick up on the first ring. Now radicals want to defund the police?”
The Facebook ad, paid for by the New York State Senate Republican Campaign Committee, said the police “stood between the rioters and your family,” an apparent reference to fires set and stores looted in Rochester over the summer following the death of George Floyd.
Ms. Brouk said the ads were backfiring. “This community doesn’t respond to that,” she said. “People have been drawn to us saying, ‘Wow. I don’t stand for that. That’s Trumpism. We don’t stand for that.’ It’s kind of energized them.”
Ms. Brouk, who is Black, is running in a mostly white district against another first-time candidate, Christopher Missick, a Republican winemaker from the Finger Lakes region who has largely self-funded his campaign.
Mr. Missick, who was endorsed by a coalition of police unions, said he supported some changes like empaneling grand juries to address the deaths of unarmed civilians in police custody. He would, however, not endorse either presidential candidate because he was intent on “running a unifying campaign.”
“I need to be able to attract voters across the lines, and I need to go to Albany to defend the interests of Democrats and Republicans in this district,” he said. “Anything that I say or do isn’t going to help either candidate.”
Republicans face daunting odds making inroads in areas like Monroe County, where Hillary Clinton beat Mr. Trump by 14 percentage points in 2016 and registered Democrats outnumber Republicans.
Democrats have tried to galvanize their base by championing the protests in Rochester, calling for criminal justice reforms and railing against Mr. Trump, who remains deeply unpopular in his native state.
“He’s fueled these racial tensions, and people are angry,” said Jeremy Cooney, a Democrat running to replace State Senator Joseph E. Robach, a Republican from the Rochester area who is not seeking re-election.
“People are really angry and they’re really upset and they see this, truthfully, as an indictment of the president,” Mr. Cooney said last week.
Still, many residents here have blamed much of the political upheaval in Rochester on local leaders, especially Mayor Lovely Warren, a Democrat.
Ms. Warren has faced a barrage of calls to resign following revelations that her administration suppressed body-cam footage of Mr. Prude’s encounter with police for months after his death in March. The footage became public this month after Mr. Prude’s family filed a public records request.
“Not only did you have an African-American die in the custody of the Rochester police department, but you have what appears to be an abdication of leadership and what may be an active cover-up in City Hall,” said Bill Napier, the chairman of the Monroe County Republican Party.
“There is no way to sit there,” he said, “and blame that on Donald Trump.”
Jesse McKinley reported from Albany, N.Y.