Mr. Kelly’s assertions were disclosed on Thursday in a statement that was filed in connection with lawsuits brought by Peter Strzok, who was the lead agent in the F.B.I.’s Russia investigation, and Lisa Page, a former lawyer in the bureau, against the Justice Department for violating their privacy rights when the Trump administration made public text messages between them.

The disclosures from Mr. Kelly, made under penalty of perjury, demonstrate the extent of Mr. Trump’s interest in harnessing the law enforcement and investigative powers of the federal government to target his perceived enemies. In the aftermath of Richard M. Nixon’s presidency, Congress made it illegal for a president to “directly or indirectly” order an I.R.S. investigation or audit.