Christopher A. Wray had considered resigning as F.B.I. director before. More than once, confronted with angry demands from President Donald J. Trump and his allies, he contemplated calling it quits.
When Mr. Wray on Wednesday announced his intent to do so, it was because he believed staying on the job into a second Trump term risked significant disruptions to the work force and its mission.
Mr. Trump had already declared his plan to replace him with Kash Patel, a tough-talking loyalist who has vowed to force out bureau leaders and empty its Washington headquarters.
In conceding to the reality of raw power, Mr. Wray’s voluntary departure could usher in a new era at the nation’s premier law enforcement agency, one in which the job of director is more of a political post that changes with the administration. For decades, F.B.I. directors have been appointed to 10-year terms to insulate them from the shifting winds of politics. Few F.B.I. directors stay a full decade, and the circumstances of Mr. Wray’s departure after seven years suggest that insulation has worn thin.
“We are now in a position in which no F.B.I. director may be expected to serve for 10 years, and every time a new president comes in, that new president is likely to signal that the director will be replaced,” said John C. Richter, a Republican and a former U.S. attorney who served in the Justice Department with Mr. Wray.
By several measures — agent recruitment and retention, arrests, and disrupted plots — the F.B.I. has been successful during Mr. Wray’s tenure, even as its politically charged cases consumed most of the public attention.