Bucks County District Attorney Matt Weintraub cemented his control on the office he’s steered since 2017, winning a tight race against his Democratic challenger.

He was joined in victory by his partner on the ballot, Fred Harran, who won the sheriff’s race. The two Republicans’ victories represented a major shift in Bucks County politics, as the GOP clawed back row offices — sheriff, prothonotary, controller and recorder of deeds — lost to Democrats four years ago.

The GOP wasn’t as successful in other suburban counties, but the slim Democratic victories in some areas, especially Delaware County, showed that the party is strengthening as a result of backlash from policy decisions in Washington.

Weintraub, in an interview Wednesday morning, said he was “very pleased” by his win of 17 percentage points over Antonetta Stancu, a former assistant district attorney in his office.

“People obviously validated our public safety campaign and the level of safety we’ve provided,” he said. “And I’m really excited to continue to serve four years.”

Stancu, who served for a decade as a local and federal prosecutor in New York and Texas before working under Weintraub, was not immediately available for comment.

Harran clinched his bid for county sheriff by a much tighter margin, beating Democrat Mark Lomax by just 7 percentage points. Speaking Wednesday, he said leaving Bensalem Township — where he’s worked in law enforcement for 34 years, most recently as public safety director — is bittersweet.

“Leaving is certainly giving me mixed emotions, but I leave Bensalem in good hands,” Harran said. “And I’m looking forward to the challenges of working in a larger jurisdiction.”

Historically a deeply red suburb, Bucks County has shifted significantly in the last four years, with Democrats edging ahead in registration by about 13,000 voters. But that trend was far from a guarantee to continue: President Joe Biden won Bucks by just 4 percentage points last year, but the county-based U.S. Rep. Brian Fitzpatrick (R., Pa.) was reelected by 13 points in the same election, despite an aggressive push by Democrats to flip his seat.

Weintraub, 52, ran on the successes of his first term, one marked by high-profile prosecutions that gained national attention, such as that of Cosmo DiNardo, sentenced to life in prison for killing four young men on a farm in Solebury Township in 2017.

On the campaign trail, Weintraub promised more of the same, and also touted his office’s creation of progressive and diversionary programs for low-level offenders and those with mental illness.

He reiterated those priorities Wednesday morning, and said that his second term will also see increased attention paid to illegal guns, especially those given to people barred from possessing them through “straw purchases” made by others.

Stancu, 43, criticized Weintraub’s record, saying he was too late to adopt a modern approach to prosecutions, and called for greater access to alternative programs for addicted or mentally ill defendants.

“We’ve spent millions of dollars in the last four or five years trying to attack the opioid epidemic, and we’re failing,” she told The Inquirer. “Mental health and drug dependency go hand-in-hand often, and without treating the underlying issues, we’ll never get a handle on our overdose rates.”

She pledged to make the office more transparent, and with her ballot partner, sheriff candidate Lomax, pushed the idea of “funding the police,” a deliberate counterpoint to the Republican idiom that Democrats are against law and order.

In Delaware County, that message was more successful, but only marginally so.

Democrats held on to the controller, register of wills and sheriff’s office by slim margins, but the race for two seats on the county council was closest of all. Incumbent Councilman Kevin Madden and newcomer Richard Womack won their race by just 1 percentage point each, narrowly edging past Republican challengers Frank Avogino and Joseph Lombardo Jr.