Republican Congressman Bob Good, chairman of the House Freedom Caucus, faced a tight primary battle on Tuesday night against a challenger supported by influential figures such as former President Donald Trump and former Speaker Kevin McCarthy.

State Senator John McGuire held a slight lead over Good in Virginia's deeply conservative 5th District as of late Tuesday night, with just a few hundred votes separating them. According to Virginia state law, if the margin remains within 1 percentage point, the losing candidate can request a recount within 10 days after the election results are certified.

Good stands at risk of becoming the first incumbent lawmaker to lose to a primary challenger this year.

In a statement posted on X Wednesday, Congressman Bob Good acknowledged the tight race, noting that provisional and mail-in ballots were still being counted and expressing confidence in his campaign's potential path to victory. He hinted at the possibility of a recount, emphasizing that the process could extend over several weeks before a definitive winner is declared.

"We are currently in a phase where the legal process ensures the accuracy of all election day vote counts, aiming to provide certainty in the certified results," Good stated on X. "We maintain optimism about our prospects."

Good's campaign drew criticism from Kevin McCarthy, one of eight Republicans who opposed his leadership last year. McGuire significantly outspent Good on advertising, with outside groups aligned with McCarthy also outspending the congressman's supporters, according to AdImpact, an ad tracking firm.

"This seems like Kevin McCarthy's payback tour," Good remarked to NBC News during an event in Goochland, Virginia, on Friday. "He seems determined to seek revenge against those he blames for his failure to become Speaker, excluding himself. But the voters of the 5th District cannot be swayed."

McGuire, who received a coveted endorsement from former President Trump, expressed gratitude to Trump upon declaring victory on Tuesday night, despite the close nature of the race.

"This is a time for unity as there is much work ahead. I am honored to be the Republican nominee and take this responsibility seriously," Good stated during his election night celebration, as reported by ABC13's livestream of his speech.

In contrast, McGuire's campaign struck a confident tone in their statement: "While there are still some votes to be counted, it is clear that victory is inevitable."

Trump endorsed McGuire three weeks before the primary, indirectly referencing Good's support for Florida Governor Ron DeSantis in the presidential primaries. Despite Good subsequently endorsing Trump, he failed to regain the former president's favor.

Trump actively supported McGuire with a television advertisement and a tele-rally on Monday night, where he criticized Good, saying, "John is running against Bob Good, who is not good. Despite his name, he’s very bad for Virginia."

Reflecting on Trump's endorsement, McGuire, a former Navy SEAL, highlighted its impact on his campaign during a community concert in Powhatan on Friday.

"Many have told me, 'I don’t know much about you, but if Trump endorses you, I'm with you,'" McGuire said. "Trump has earned the right to lead and pick his team through all he's been through."