President Donald Trump warned congressional Democrats Thursday against pursuing impeachment proceedings against War Secretary Pete Hegseth if they win control of the House in next week’s midterm elections, suggesting Republicans could respond with similar tactics.

Speaking to reporters before departing for a rally in South Carolina, Trump criticized Democrats for repeatedly threatening impeachment and defended Hegseth’s leadership at the Department of War.

“I think it’s terrible,” Trump said, according to the Washington Examiner. “All they do is they talk about impeaching everybody.”

Trump added that Republicans could use the same strategy if Democrats chose to pursue it. “I mean, honestly, if we wanted to play that game, we could play it just as well,” he said.

The president praised Hegseth’s performance, calling him “a great warrior” and saying he believed Hegseth was the best person to hold the position in many years. Trump did not specify which officials Republicans might target or what action he would take in response to a Democratic impeachment effort.

The warning comes as Democrats seek to retake the House, where a majority would give them the ability to advance impeachment proceedings. The Cook Political Report recently assessed Democrats as favored to win the 218 seats needed for control of the chamber. Its ratings placed 220 seats in the Solid, Likely or Lean Democrat categories, compared with 198 for Republicans, while 17 races remained toss-ups.

Democrats have focused criticism on Hegseth’s handling of the war with Iran, which began Feb. 28, as well as military strikes against boats in the Caribbean tied to the administration’s campaign against drug trafficking. The conflict with Iran has also contributed to higher gasoline and diesel prices.

In April, House Democrats filed six articles of impeachment against Hegseth, accusing him of “high crimes and misdemeanors” related to the war and the Caribbean operations. Rep. Yassamin Ansari, an Arizona Democrat and the first Iranian American woman elected to Congress, led the effort.

Hegseth also faces an impeachment challenge from within his own party. Rep. Thomas Massie, a Kentucky Republican, has said he intends to force a House vote on impeachment articles against the War secretary after lawmakers return following the elections. Massie has accused Hegseth of illegal conduct in Iran and other military operations.

Massie is scheduled to leave Congress in January after losing his Republican primary, setting up a potential impeachment fight during his final months in office.

Trump has previously threatened to veto every piece of legislation sent to him during the second half of his administration if Democrats take control of Congress. His latest remarks underscore the prospect of intensified conflict between the White House and congressional Democrats if the balance of power shifts after the midterm elections.