In 2020, Republicans branded Democrats as hostile to police, a message many in the Democratic Party think cost them scores of congressional and state legislative races.

Anticipating similar attacks in this year’s local elections, Democrats in a key Pennsylvania swing county are highlighting their law enforcement bona fides. While stopping short of embracing the Republican Party’s law-and-order rhetoric, Bucks County Democrats are trying to head off any suggestion that they want to “defund the police.”

Democrats hope the message will help them oust the sole remaining Republican countywide row officer in the collar counties surrounding Philadelphia and serve as a model for winning competitive races in next year’s midterm elections. A defeat would energize Republicans as they seek to take control of Congress, retain their majorities in the state legislature, and win back the governor’s mansion in 2022.

“We know to fight crime we must fund the police,” Mark Lomax, a retired State Police major and the Democratic nominee for Bucks County sheriff, says in a television ad that started running Wednesday featuring him and Antonetta Stancu, the party’s candidate for district attorney.

“That’s how we get more community policing, programs for mental health treatment, and improved training for officers to do their jobs better and keep us safer,” says Stancu, a former prosecutor in Bucks and elsewhere.

In an interview, Stancu said she and Lomax are battling “a misperception [that] because one identifies as a Democrat, that they are not in favor of working with law enforcement, that they’re not a supporter of law enforcement.”

“I was in law enforcement for 16 years,” said the 43-year-old Doylestown resident, adding that Lomax served 27 years as a trooper. “It’s a part of who we are, and it’s in our blood. ... But that doesn’t mean we don’t want progress, doesn’t mean we don’t want to continue to work to make things better.”

Lomax, a 62-year-old Warrington Township supervisor, has already been forced to navigate the tricky politics of policing. After the incumbent sheriff, Milt Warrell, lost the party’s endorsement this spring, he claimed insiders wanted to support a critic of law enforcement. Bucks Democrats denied the charge, pointing to Lomax’s resumé, and he won the May primary.

But the issue could bubble again in November’s election. The GOP nominee, Fred Harran, 57, Bensalem’s director of public safety, has touted support he won from Philadelphia Fraternal Order of Police Lodge 5.

Neither office has authority beyond their borders — the district attorney oversees all prosecutions and county-run criminal investigations, and the sheriff is responsible for court security and tasks like serving warrants and prisoner transfers. But both jobs are among the highest-profile law enforcement jobs in any county, and a victory has deeper significance.

Stancu’s opponent, incumbent Matthew Weintraub, is the only Republican still holding a row office in Chester, Montgomery, Delaware, or Bucks Counties — regional governments that for decades had been dominated by the GOP. And the success of the strategy in Bucks, a bellwether county where Democrats had mixed success during Donald Trump’s presidency, could offer broader lessons for the party.

President Joe Biden carried Bucks by 4 percentage points, but U.S. Rep. Brian Fitzpatrick (R., Pa.) was reelected to his Bucks-based seat by a resounding 13 points despite being targeted with millions of dollars in attack ads. Republicans also held on to state legislative seats that Democrats tried to flip last year.

» READ MORE: ‘Ticket-splitting’ voters in Bucks County show it’s the most competitive Philly suburb

In addition to allying themselves with law enforcement, Democrats are accusing Republicans of endangering public safety by opposing mask mandates and other COVID-19-related restrictions.

“We are laying the groundwork here in ’21 for what we believe is going to be the message Democrats will run on in ’22,” said Kunal Atit, campaign manager for Bucks United, the party’s campaign apparatus.

Republicans appear poised to highlight domestic and foreign policy issues on which polling shows the public is unhappy with Biden. “Voters have had enough of Democrat failures at home, like you’re seeing at the border, and failures abroad like the disastrous withdrawal from Afghanistan,” Bucks County GOP chair Pat Poprik said in a statement. “They’ve had enough of out of control spending, rising gas prices, and skyrocketing inflation.”

She said the Democrats’ television ad is meant to deflect from the party’s record on policing. “Look at a city like Philadelphia, which has Democrat Larry Krasner as District Attorney, and sadly just marked its 400th murder for the year.”

Democrats say they are antsy that their party’s core voters aren’t as energized as Republicans, and they’re committing significant resources to make up for that potential enthusiasm gap. Bucks Democratic leaders expect to spend as much as $1.5 million on local races, they say, which may well exceed campaign budgets for statewide judicial candidates.

They have 16 paid staffers and more than 100 volunteers who have already knocked on 72,000 doors — the largest turnout operation in the state, Atit said.

Stancu’s former boss, Weintraub, was appointed district attorney in 2016 to fill a vacancy, then elected to a four-year term in 2017 — despite Democratic wins across the region that year. He said his election showed that “people saw my service as exceptional” and wanted it to continue.

“People want to feel safe,” the 52-year-old Doylestown Township resident said in an interview Tuesday. “They are concerned about their governmental power, whether they are safe from the potential creep from Philadelphia, from Trenton, and we’ve done a great job in distinguishing ourselves here in Bucks County from some of the terrible crime trends that we see in Philadelphia.”

He also said that while voters won’t always agree with him, “one thing you can take to the bank is that every one of my decisions has not been based on politics but rather on principle.”

But the election results also could be influenced in an unusual way by races down the ballot: After last year’s school closings, continued debate over masking, and heated rhetoric over the teaching of race, dozens of school board seats could spur turnout.

After the Central Bucks school board last month voted down a mask requirement on a 5-4 vote, a board member said he received a death threat and decided to resign. The Wolf administration’s order this month mandating masks didn’t bring an end to the rancor. Polling shows broad support for mask mandates in schools, though Republicans are more likely to oppose them.

COVID restrictions could also come into play in the DA’s race. When Gov. Tom Wolf last year ordered people to wear masks inside places of business, Weintraub advised local police chiefs to leave enforcement to the State Police.

Stancu criticized the move. “Our parents are feeling as though they’re concerned about their kids’ safety,” she said.

Weintraub said his policy has remained the same throughout the pandemic.

“Our cops are an incredibly limited and valuable resource,” he said. “I need them to be available at all times to respond to emergencies, to investigate crime, and to keep us safe. And I would put mask police at a very, very distant place down on that list.”