WASHINGTON — Lawyers for James A. Wolfe, the Senate intelligence staff member accused of lying about his contacts with reporters, asked a federal judge on Tuesday to order President Trump to stop commenting on the case or risk compromising Mr. Wolfe’s right to a fair trial.

In their motion, filed in Federal District Court in Washington, the lawyers, Benjamin Klubes and Preston Burton, noted that after Mr. Wolfe’s arrest on June 7 that Mr. Trump told reporters the government had “caught a leaker,” calling him “a very important leaker.”

The president, who has complained vociferously about leaks to journalists, said the arrest “could be a terrific thing.” He added: “I’m a very big believer in freedom of the press, but I’m also a believer that you cannot leak classified information.”

But Mr. Wolfe, the longtime security director for the Senate Intelligence Committee, has not been charged with disclosing classified information. He faces three counts of making false statement to F.B.I. agents, by denying that he had spoken to four reporters, including Ali Watkins, a reporter for The New York Times. Mr. Wolfe and Ms. Watkins had a three-year personal relationship that ended last year.