Republican Ohio state Sen. Troy Balderson was certified the winner of Ohio's 12th Congressional District on Friday, denying Democrats the major upset they had sought ahead of the November midterm elections.

The Trump-backed Balderson had declared victory over Democrat Danny O’Connor on Aug. 7, but O’Connor had declined to concede because of the small margin.

According to the Associated Press, after final absentee and provisional ballots were counted, Balderson defeated O'Connor by 1,680 votes — a mere 0.8-percent margin in a district Trump won by 11 points two years ago.

The result fell 520 votes outside the window to trigger an automatic recount.

Balderson takes the seat previously held by Republican Pat Tiberi, who resigned in January to take another job.

But Balderson and O’Connor will face each other again in November for a full term.

The special election was a test of voter sentiment before November's high-stakes general election, which will decide which political party controls the House.

Balderson's victory buoys Republicans concerned over how Trump might be playing among voters, especially in political battleground states such as Ohio. O'Connor's odds were considered long in the gerrymandered district, which has been held by Republicans for nearly 35 years.

Republicans had seized on O’Connor’s comments on MSNBC about whether he would support Democrat Nancy Pelosi for speaker, accusing O’Connor of telling swing voters he would vote against Pelosi for speaker – even though he’d support her if the party needed him for Pelosi to get 218 votes.

Fox News' Gregg Re and The Associated Press contributed to this report.