Defense Secretary Pete Hegseth stepped into Kentucky politics on Monday, traveling to the state to deliver remarks aimed at weakening Rep. Thomas Massie on the eve of Massie’s GOP primary in the state’s 4th Congressional District. The appearance marked what the Associated Press described as an unusual departure from wartime duties as Trump sought to demonstrate continued influence over fellow Republicans in the run-up to midterm elections.

Hegseth’s remarks included a repeated focus on the relationship between Massie and President Donald Trump, even as he presented his appearance as personal rather than official. The Pentagon chief told the audience he was speaking “as a private citizen” and not as a member of Trump’s Cabinet, yet he referenced Trump “over and over” as he praised Massie’s rival, former Navy SEAL Ed Gallrein.

In those comments, Hegseth argued that “President Trump needs reinforcements,” saying that “war fighters” back leaders, and he said Massie has “acted like his job is to stand apart from the movement” Trump leads rather than strengthening it. Hegseth also contrasted Massie’s approach with a desire to provide “backup,” adding that when Trump needs reinforcement, Massie “wants to debate process” instead.

The political context for the trip is the GOP primary between Massie, a congressman who has openly clashed with Trump, and Gallrein. The Associated Press reported that Massie’s campaign has become a prominent test of Trump’s clout, noting that the president’s allies have poured “tens of millions of dollars” into opposing Massie and that the race has developed into what the AP described as the most expensive congressional primary in U.S. history.

Massie, for his part, criticized the use of high-level national figures to shape his primary. In comments Sunday on ABC’s “This Week,” Massie said the response to his candidacy reflected urgency from Trump and allies, telling the program, “They’re desperate. That’s why they’re sending the secretary of war to my district,” and adding that he believed the president was “losing sleep and tweeting about this.”

The Pentagon also addressed concerns that Hegseth’s remarks could violate election-related rules. Ahead of his Kentucky appearance, the Pentagon issued a statement responding to criticism that the defense secretary might be breaking the law by using taxpayer resources for political purposes, according to the Associated Press report.

Chief Pentagon Spokesman Sean Parnell said Hegseth was attending in his “personal capacity,” and he said, “No taxpayer dollars will be used to facilitate his visit.” Parnell added that Hegseth’s participation had been “thoroughly vetted and cleared by lawyers,” including the Department of War Office of General Counsel, and that the trip “does not violate the Hatch Act or any other applicable federal statute,” the statement said.

For Trump, the Kentucky race offered another opportunity to test how much influence his allies can wield against GOP incumbents who criticize his war policy. The Associated Press noted that Hegseth’s political appearance arrived as Trump faced heightened concerns about the economy and the Iran war less than six months before the midterm elections, setting the stage for competition between cabinet-level messaging and congressional dissent inside the Republican Party.