WASHINGTON — The morning, at least, seemed to go reasonably well for President Trump. He announced a new F.B.I. director, and two intelligence chiefs told Congress the president had never pressured them to interfere in the investigation into Russian election meddling.

And then James B. Comey, the F.B.I. director who was fired by Mr. Trump last month while leading an investigation into the president’s associates, dropped the hammer. By authorizing the immediate release of the opening statement he plans to give in his much anticipated appearance before a congressional committee on Thursday, he instantly changed the conversation back to his assertion that the president tried to shut down part of the F.B.I. investigation.

Mr. Trump may be relatively new to Washington, but Mr. Comey is not.

A savvy veteran of the capital who has worked in high positions in multiple administrations, he has usually emerged on top in any internal power struggle. And in the month since his dismissal, Mr. Comey has shown why presidents are normally loath to fire F.B.I. directors.

The release of Mr. Comey’s statement and the prospect of his televised testimony left the White House on the defensive on Wednesday. The president’s nomination of Christopher A. Wray to lead the F.B.I. and his trip to Ohio to discuss infrastructure were overshadowed, and administration aides were left grumbling about the coming spectacle of a longtime lawman accusing the commander in chief of actions that some lawyers call obstruction of justice.