President Trump said Thursday that House Minority Leader Nancy Pelosi’s threat to use a Democratic House's ability to subpoena Trump administration officials as a negotiating tool with Trump is against the law.

“Pelosi says she’s going to mechanize the speakership and use it as a great negotiation with the president. That’s an illegal statement,” Trump told the Washington Times .

If Democrats were to win in the midterm elections next week, and Pelosi, D-Calif., were to win back the House speaker position, Trump said her subpoena threat would lead to a legal battle all the way up to the Supreme Court.

“That alone takes two years to get it to the Supreme Court — that statement — before you do anything,” Trump said. “You heard her the other night.”

Pelosi made her comments last week during CNN’s campaign forum, claiming that subpoena power would be a useful tool when negotiating with Trump.

“Subpoena power is interesting, to use it or not to use it,” Pelosi told CNN . “It’s a great arrow to have in your quiver in terms of negotiating on other subjects.”

Trump said he is optimistic that Republicans will maintain their majority in the House, and said he is not worried about impeachment threats by a Democrat-run House.

“They can play that game, but I can play that game also,” Trump said.

[Opinion: Nancy Pelosi promises no civility unless Democrats win the midterm elections]