After Mr. Sessions recused himself, Mr. Trump asked his attorney general to reverse his decision — a request that has raised the interest of the special counsel, Robert S. Mueller III.

During the course of his Senate confirmation hearings early last year, as rumors circulated about an investigation into Russia’s possible coordination with Mr. Trump’s presidential campaign, Mr. Sessions was asked whether he would recuse himself. At the time, Mr. Sessions said he did not know of a specific reason as to why he should do so.

But he also said, “If a matter arose in which I believed my impartiality might reasonably be questioned, I would consult with department ethics officials regarding the most appropriate way to proceed.”

After being criticized when it was disclosed that he had contacts with the Russian ambassador during the 2016 campaign, Mr. Sessions recused himself from any inquiry into Russia’s election meddling and possible coordination with Mr. Trump’s political aides.

Mr. Sessions insisted there was nothing suspicious about his two meetings with the Russian ambassador, Sergey I. Kislyak. But, he said, he made the decision to recuse himself after consulting with Justice Department officials.

More recently, Mr. Trump has joined some of his Republican allies in Congress in protracted attacks on the Justice Department, this time over congressional requests for some of the F.B.I.’s most closely held secrets.

Mr. Trump has claimed, without evidence, that the F.B.I. planted a spy inside his campaign.

The quotes by Mr. Gowdy that the president highlighted in a series on Twitter posts on Wednesday morning appeared to validate Mr. Trump’s feelings toward his attorney general.