Former state Rep. Geoff Duncan pulled off an upset win against state Sen. David Shafer, narrowly securing the Republican nomination for lieutenant governor.

According to unofficial results from the Secretary of State’s office, Duncan won by less than one percent of the vote — about 1,700 votes.

Duncan declared victory on his Twitter account late Tuesday.

“Congratulations to David Shafer on his service to our state and on a very competitive race,” he wrote.

The Cumming Republican held Shafer off in an extremely close race – one that Shafer almost won outright in the May primary with nearly 50 percent of the vote in what was then a three-way race.

Live: Complete runoff election results

Duncan, who served in the state House for five years, ran a campaign as an underdog outsider, often referring to Shafer as "the next in line" to serve as lieutenant governor.

He also hit Shafer hard on the campaign trail, consistently raising questions about how the Duluth Republican accumulated his $5.6 million net worth and reminding voters Shafer was accused, and cleared, of sexually harassing a lobbyist.

Shafer was cleared in April by the Senate Ethics Committee when lawmakers dismissed a sexual harassment complaint filed by a lobbyist.

Duncan will face Democrat Sarah Riggs Amico, a business executive from Smyrna who is running her first political campaign.