In its 110 years, the FBI has weathered storm and scandal. It has had moments that make Americans proud of its crime-fighting and anti-terrorist activities. Yet its most celebrated and longest-serving leader, J. Edgar Hoover, for whom the imposing headquarters on Pennsylvania Avenue is named, is remembered in large part for the abuses of power that took place during his reign.

What is occurring today is different. It is more like the crumbling of the foundations of an agency that on its best days personifies the finest in government service and law enforcement. Like much about today’s political environment, the problems began before President Trump was elected but have become far worse during his time in office.

There can be no strong foundation at the FBI when the pillars of leadership are all under assault, starting at the very top — the Justice Department. Attorney General Jeff Sessions recused himself from the Russia investigation, which later became special counsel Robert S. Mueller III’s investigation into Russian interference in the 2016 election, possible collusion by Trump campaign associations and now much more. Sessions’s recusal is, in Trump’s eyes, the original sin for which he has never forgiven the former senator.

Sessions not only is a bystander to the Russia probe but also has been weakened by constant disparagement that comes from the Oval Office. His precarious position, despite occasional instances of pushing back, undermines what should be the Justice Department’s independence from the White House. The president has sought to cripple the chief law enforcement official in the government and, with it, the department.

Sessions’s deputy, Rod J. Rosenstein, a career prosecutor, has no job security either. It was he, after Sessions’s recusal, who decided to appoint a special counsel and hand the Russia investigation to Mueller. The wrath the president expresses toward Sessions has been transferred to Rosenstein, though it was Rosenstein who was asked to provide the memo that formed the pretext for the firing of FBI Director James B. Comey.

Rosenstein’s ability to manage and lead has been compromised by the president. Now, the president’s allies in Congress have joined in applying pressure on him. He retains his job, despite constant talk that he could be fired, but he must walk into the building each day and wonder if it will be his last on the job. There is one positive sign amid all this: The Post reported Friday that Sessions has warned that he might leave his post if Rosenstein is fired.

Comey’s tour promoting his new book, “A Higher Loyalty: Truth, Lies and Leadership,” highlights the degree to which the tables have turned, both for him and the agency he once headed. Praised as the straightest of shooters when he was in government, and described as a career official with an impeccable reputation for integrity, Comey now has taken sides in the highest-stakes battle in the capital.

His detractors are manifold, from the Democrats who believe he cost Hillary Clinton the presidency by reopening the investigation into her use of a private email server just before the election, to the Republicans who see him as part of a plot to take down the president. The more attention given to Comey, the more the president seems determined to tear down the man he sees as one of his principal antagonists.

Comey’s book was an opportunity to make the case for himself and his past decisions, to lay out the record as clearly as possible. What he recounts from his interactions with the president is damning, just as his prior testimony before Congress was. Those accounts are backed up by contemporaneous memos he made. They have been shared with Congress and become public. They buttress the testimony he gave a year ago.

Yet, any hope Comey might have had of being seen as dispassionate in telling the story of the president’s response to the Russia probe and their interactions was undercut by some of his petty personal asides in the book and by using his book tour to declare that he believes Trump is “morally unfit.”

Comey is entitled to his opinions about the president, but he has given his critics the opening to paint him as a partisan rather than as a law enforcement official.

The president has seized the opportunity. The release of Comey’s books brought a cascade of angry tweets. The president’s goal is obvious: to discredit a potentially damning witness, just as he is trying to discredit the Mueller investigation. By responding to Trump’s taunts, Comey risks becoming another example of what happens to people who grapple with the president: They are swept into a tangle of tweets, charges and countercharges, and find themselves diminished.

As Comey struggles to fend off his critics, the agency he once led is in the middle of a damaging controversy involving Andrew McCabe, the former FBI deputy director who was fired by Sessions a day before his scheduled retirement. He now faces the possibility of criminal charges for authorizing the sharing of information with the Wall Street Journal about investigations involving Clinton and, according to the department’s inspector general, later misleading investigators. The inspector general has referred the matter to prosecutors for their consideration.

Like Comey, McCabe also has been a frequent target of the president. The Comey memos show Trump was on McCabe’s case early in his presidency. He saw McCabe as a partisan and as a willing partner of Comey and others in provoking the Russia investigation he has repeatedly derided as a “witch hunt.”

McCabe is bitter at the treatment from the president and his allies. The IG report has also ruptured the relationship between McCabe and Comey, who differ on what happened in the process of sharing the information with reporters.

The president, who misses nothing in these matters, seized upon their disagreement last week in one of his tweets about Comey, saying that the former FBI director had thrown McCabe “under the bus,” and calling the inspector general’s report “a disaster for both of them.” For Trump, it is an ideal outcome to see two men he dislikes at war with each other, though his satisfaction might be premature, as the whole story has more time to run.

Restoring the FBI to its former status will not be easy nor can it be swift. To the degree that public confidence has been shaken by these events, the path ahead is not obvious because there are conflicting interpretations of what the problem is. Trump has his version of events, Comey has his, McCabe has his. Sessions probably has his. FBI Director Christopher A. Wray can do little as long as the volleying over his head continues. Like so much else these days, the FBI is in danger of becoming one more partisan battlefield in an endless and consequential war.