Bob Casey and Dave McCormick
CNN  — 

Democratic Sen. Bob Casey on Thursday conceded the high stakes Pennsylvania Senate race to Republican Dave McCormick.

“During my time in office, I have been guided by an inscription on the Finance Building in Harrisburg: ‘All public service is a trust, given in faith and accepted in honor,’” he said in a video posted on X. “Thank you for your trust in me for all these years, Pennsylvania. It has been the honor of my lifetime.”

On Friday, Pennsylvania’s secretary of the commonwealth announced the state was stopping its recount of the Senate race results at Casey’s request. The automatic recount had been trigged after unofficial results showed the margin between McCormick and Casey within one-half of 1%.

Currently, McCormick leads by about 16,000 votes, or 0.2 percentage points. Counties must certify their final results by Monday.

McCormick’s victory is a major upset for the three-term Democratic incumbent in the key battleground state, which also swung back to Donald Trump on the presidential level this year.

The Senate race had tightened in the final months of the campaign, but Casey had an edge in most polling of the race for much of his campaign against McCormick, a former hedge fund executive who lost a bid for the state’s other Senate seat in 2022. Republicans and Democrats alike spent big in Pennsylvania as it emerged as a pivotal battleground up and down the ballot.

McCormick frequently appeared with Trump at his rallies this year after losing out on the former president’s endorsement during the primary two years ago. And although the GOP Senate nominee often appeared to be running behind Trump in his contest with Vice President Kamala Harris in public polling of the race, he and his GOP allies leaned into the issue of immigration, which was at the center of the Republican Party’s 2024 election strategy.

Republicans hammered Casey on the issue, dedicating millions of dollars in attack ads tying the senator to the Biden administration’s record on the border.

McCormick, the former CEO of Bridgewater Associates, made an anti-incumbency argument, calling Casey “too weak” and asking voters in one of his closing messages to “make a change,” while recapping his bio as a West Point graduate.

McCormick, whose wife Dina Powell worked as a national security adviser to Trump, was nearly onstage during a July assassination attempt against the former president in Butler, Pennsylvania. But Trump told him to stay seated for another few minutes, shortly before the gunman struck.

McCormick’s victory means Pennsylvania will, for at least the next four years, be one of the few states with senators from different parties. Democratic Sen. John Fetterman beat Mehmet Oz, the famed television doctor, in 2022, for his first six-year term.

CNN’s Ethan Cohen and Morgan Rimmer contributed to this report.