It took six weeks to determine, but House Freedom Caucus chair Rep. Bob Good of Virginia was defeated in his bid for renomination by a challenger supported by former President Trump.

John McGuire, a Virginia state senator and former Navy SEAL backed by Trump, will win the Republican primary in Virginia's reliably red 5th Congressional District, in the southern part of the Commonwealth. '

McGuire came out on top in a recount conducted Tuesday. Election officials certified that McGuire won the June primary election by 374 votes out of nearly 63,000 ballots cast, or six-tenths of a percentage point. 

But because McGuire's victory margin in the primary was less than one percent, Good was able to seek a recount. But he had to pay for the recount, because the margin was greater than half a percent.

FOX NEWS POLL: BIDEN, TRUMP IN A DEAD HEAT IN VIRGINIA

Rep. Bob Good speaks at press conference

Rep. Bob Good (R-VA), chairman of the House Freedom Caucus, speaks alongside fellow members during a press conference on the government funding bill, at the U.S. Capitol on March 22, 2024 in Washington, D.C. (Photo by Kevin Dietsch/Getty Images)

Good becomes the first House Republican incumbent this election cycle to be ousted by a primary challenger, in a contentious intra-party primary battle that pitted conservatives versus conservatives and Trump against some of his biggest allies in the House of Representatives. 

Good incurred Trump's wrath for being one of just a handful of House Republicans to endorse Florida Gov. Ron DeSantis in the GOP presidential primaries.

Even though the two-term congressman avoided criticizing Turmp and quickly endorsed the former president after DeSantis ended his White House bid in January, Trump wrote on this Truth Social platform that "the damage has been done!"

The former president in May endorsed McGuire, who also had the backing of Rep. Marjorie Taylor Greene of Georgia, a conservative firebrand and major Trump ally who is a vocal critic of Good who last year broke with the House Freedom Caucus. The group is considered the most far-right organization of lawmakers in the chamber.

Republican California Rep. Kevin McCarthy

Then-Rep. Kevin McCarthy, a Republican from California, at the US Capitol in Washington, D.C., on Tuesday, Oct. 3, 2023, as he was ousted as House Speaker. (Nathan Howard/Bloomberg via Getty Images)

MARJORIE TAYLOR GREENE BACKS CHALLENGER TO FREEDOM CAUCUS CHAIR AS 2024 STIRS HOUSE GOP CIVIL WAR

Former House Speaker Kevin McCarthy also targeted Good, who was one of eight Republicans last autumn who joined with Democrats to vote to oust McCarthy from his leadership position.

However, Good had the support of Reps. Matt Gaetz and Byron Donalds of Florida, two conservatives who are also strong backers of Trump.

CLICK HERE TO GET THE FOX NEWS APP

Additionally, fellow House Freedom Caucus members, Reps. Chip Roy of Texas and Andy Biggs of Arizona, joined Good in Virginia for a rally on Friday.

Even though he was targeted by Trump, Good spotlighted his support for the former president as he ran for re-election.

"Happy Birthday to the best and next president of the United States, President Trump!" Good wrote on social media on Friday, on the former president's 78th birthday.

Good also showed up earlier this spring at Trump's criminal trial in New York City, to show his support for the former president.

Get the latest updates from the 2024 campaign trail, exclusive interviews and more at our Fox News Digital election hub.