Author J.D. Vance, who last month earned former President Donald Trump's late endorsement in Ohio's Republican Senate primary, has won the GOP contest, according to a race call from The Associated Press.

Vance topped Josh Mandel, a former state treasurer who had pitched himself in Trump's mold, and who had been near the top of polls for months.

The Republican nominee will face off against Democratic U.S. Rep. Tim Ryan, who won his party's contest earlier Tuesday evening, the AP said.

Vance, who rose to conservative prominence after writing the memoir Hillbilly Elegy, also beat state Sen. Matt Dolan in the GOP primary, along with Mike Gibbons, an investment banker, and former state Republican Party Chair Jane Timken.

Even before Trump endorsed Vance, the race had become somewhat of a test of who could be the most Trump-like.

One Mandel ad said he was "pro-Trump" while Timken said she was "the real Trump conservative." Gibbons compared his businessman background to Trump's.

Vance, meanwhile, had a history of criticizing the former president, which is part of the reason Trump's endorsement came as a surprise to many in Ohio.

In 2016, Vance had called Trump "reprehensible" and an "idiot," but in his primary campaign, Vance did a 180 and said those comments were "stupid." He's since referred to Trump as "the greatest president in my lifetime."