Republican Ashley Moody will face off against Democrat Sean Shaw in the Nov. 6 general election.

Moody defeated Frank White 56.7 percent to 43.2 percent with 86 percent of the vote in the GOP primary and Shaw defeated Ryan Torrens with 73 percent of the vote and 86 percent of the precincts counted in the Democratic race.

The winner will replace Attorney General Pam Bondi, who can't run again because of term limits.

There almost wasn’t a Democratic primary. Democratic state Rep. Shaw, who had a larger campaign cache and establishment support, filed a lawsuit to get Tampa attorney Torrens off the ballot.

Torrens responded by suing Shaw for libel. Just four days before the primary, a judge agreed that Torrens used an illegal donation to pay the qualifying fee to get on the ballot, and ruled that no votes for him should be counted. But an appeals judge put a stay on the decision on Monday, keeping Torrens’ campaign alive.

The Republican contest emerged as the most divisive of the Cabinet contests. White, R-Pensacola, hammered Moody, the former Hillsborough County Circuit judge, over her family’s part in a condominium-development lawsuit against Trump nearly a decade ago and for having once been a registered Democrat.

In a recent ad against Moody, an announcer proclaimed, “Ashley Moody was a lifelong Democrat.” The ad includes an edited part of an audio clip from a TV reporter who said, “It’s true Ashley Moody was first a registered Democrat, but it’s false she has been her whole life. She entered college as a Democrat and in her 20s became a Republican.”

Moody’s campaign, which has the backing of Bondi, had labeled White a “car salesman turned politician” with no prosecutorial experience. White is a freshman legislator who is an executive of a chain of family-owned auto dealerships.