President Trump attempted to have two of his largest rivals prosecuted by the Justice Department but was discouraged by White House counsel, according to a report published on Tuesday.

Trump sought to order the legal action against his 2016 presidential opponent, Hillary Clinton, and former FBI director James Comey earlier this year, according to The New York Times.

The White House counsel, Donald McGahn, warned the president that he had no authority to order a prosecution and added that the move could lead to impeachment, the paper said.

It was not clear what laws Trump believes Clinton or Comey allegedly broke.

Trump repeatedly called to “lock up” Clinton on the campaign trail for her use of a private email server during her tenure as secretary of state.

A lawyer for McGahn told the Times that Trump “never, to his knowledge, ordered that anyone prosecute Hillary Clinton or James Comey.” The lawyer, however, did not address whether the topic of prosecuting them was discussed.

The White House did not comment on the report.