Kentucky U.S. Rep. Thomas Massie lost his Republican House primary to Ed Gallrein, marking a victory for former President Donald Trump, according to the Associated Press. Trump’s endorsement and support played a significant role in Gallrein’s win, demonstrating the former president’s influence over GOP voters.

The race between Massie and Gallrein was the most expensive U.S. House primary in history. Massie, who had served in Congress since 2012, had often opposed Trump, pushing for the release of the Jeffrey Epstein files, criticizing the war in Iran, and voting against the president’s tax legislation last year, the AP reported.

Despite his efforts to convince voters that he could support both his own principles and Trump, Massie lost to Gallrein, a former Navy SEAL who ran on his military service and loyalty to Trump.

In his concession speech, Massie criticized what he described as unwavering fealty to Trump in Congress, stating, “If the legislative branch always votes whichever way the wind is blowing, then we have mob rule. But if lawmakers follow the Constitution, “we have a republic.” He teased a potential run in 2028, saying, “we’ll talk about it later,” according to the AP.

Gallrein delivered a shorter speech at his victory party, thanking Trump, who visited Kentucky in March to support his campaign. He accused Massie of forsaking Trump and the party. Gallrein is favored to win the general election against Democrat Melissa Strange in the deeply red district, the AP reported.

Trump, speaking with reporters after Massie’s defeat, said: “He was a bad guy. He deserves to lose.” White House communications director Steven Cheung said via social media: “Do not ever doubt President Trump and his political power.”

The primary campaign intensified as Massie recruited other Republicans, including Rep. Lauren Boebert, for support. Trump responded by increasing his social media attacks, calling Massie “an obstructionist and a fool,” according to the AP.

In addition to Massie’s defeat, Republicans statewide chose U.S. Rep. Andy Barr as their nominee to replace Mitch McConnell. Barr, who was endorsed by Trump, defeated Daniel Cameron, a former state attorney general.

Barr thanked his primary opponents, Trump, and McConnell “for his decades of service to our commonwealth and this country” in his victory speech, according to the AP.