Former FBI agents say it may take a long time to wash away the stain of political-bias accusations lobbed against the bureau, which has long been viewed as the nation's premier law enforcement agency.

Criticism of the storied bureau has been bipartisan. Republicans point to accusations that the agency mishandled the justification for spying on a Trump campaign figure, and Democrats are furious at the FBI's investigation of presidential candidate Hillary Clinton over her email and private server while she headed the State Department.

In between are a slew of embarrassing text messages from an agent involved in both the Trump and Clinton investigations, revelations of top officials' partisan ties, and a wave of demotions and ousters.

"If people start looking at the FBI as a political organization, the taint will be incredible," said James Wedick, a 34-year agency veteran who now works as an investigator.

The accusations have taken a toll on the bureau. The New York Times last week published an op-ed column from Josh Campbell, a former supervisory special agent who said informants may be less willing to come forward in a terrorism investigation, or a jury may not give an agent testifying at trial the same expectation of truth it once would have.

Mr. Campbell wrote the piece to announce he was quitting the FBI in order to take a public role in defending it. He blamed President Trump and his allies for unfairly sullying the bureau.

"A small number of my current and retired colleagues have said that we should simply keep our heads down until the storm passes. I say this with the greatest respect: They are wrong," Mr. Campbell wrote. "If those who know the agency best remain silent, it will be defined by those with partisan agendas."

Former agents' disagreements over the cause of the taint spills over into the prescription for fixing it.

One of the several agents who spoke to The Washington Times said the usual oversight process may help restore confidence, and another said it will take FBI Director Christopher A. Wray to step in with an overhaul. Another agent said it may take a special prosecutor to get to the bottom of the bureau's behavior.

"It looks to me like some FBI executives violated the law by filing a fraudulent affidavit to spy on an American citizen," Mr. Wedick said. "That's going to warrant a special prosecutor. I don't see how they avoid this."

Lewis Schiliro, a former head of the agency's New York office, suggested having the inspector general release a comprehensive report on the FBI's activities.

Sanford Ungar, director of the Free Speech Project at Georgetown University and author of a book on the FBI's history, said a special prosecutor would further politicize the battle over the bureau's behavior.

"Another line of independent inquiry that is subject to political manipulation is not a good idea," Mr. Ungar said. "To inject another probe could risk harming the bureau in ways that even Mr. Trump wouldn't want it harmed."

Mr. Ungar said Mr. Trump could help restore faith in the bureau by cooling his criticisms, which he suggested was driven by short-term political calculations.

"If you tear down an institution like this, you can't just build it back up next week," he said. "You have to be careful about tearing down institutions that are the bedrock of our democracy because you will cause irreparable damage to the government that maligned it."

The bureau sustained its latest dent on Friday when a memo from the House Permanent Select Committee on Intelligence said the FBI used the Steele dossier - a collection of unverified reports that was funded by the Clinton campaign - to apply for a warrant under the Foreign Intelligence Surveillance Act to spy on former Trump campaign aide Carter Page.

"There was a perception that the FBI had lost its objectivity with how it handled the Hillary Clinton investigation, and now the FISA memo just adds to that," Mr. Schiliro said.

Politicians of every stripe, from Mr. Trump on down, insist they aren't questioning the integrity of the 13,000 agents, 3,100 intelligence analysts and 19,000 other support staff.

But the leadership has been in turmoil for months. Mr. Trump fired Director James B. Comey last year, and Deputy Attorney General Andrew McCabe took early retirement this year amid accusations that he slow-walked the Clinton email investigation.

The inspector general is reviewing why Mr. McCabe, the second-highest-ranking official at the FBI, "appeared not to act for about three weeks" after new Clinton emails were discovered just weeks before the election.

Mr. McCabe's wife, Jill, ran for state Senate in Virginia and had accepted a campaign contribution of nearly $500,000 from Gov. Terry McAuliffe, Virginia Democrat and chairman of Mrs. Clinton's 2008 presidential campaign.

"When I was at the bureau, the question was never 'Is it wrong?' It was 'Does this look wrong?' " Mr. Wedick said. "If it didn't look good, you weren't allowed do that. How McCabe's wife took that money, given his position, is incredible to me."

The FBI's troubles deepened last year when agent Peter Strzok was revealed to have sent bureau attorney Lisa Page, with whom he was having an extramarital affair, multiple texts in support of Mrs. Clinton's presidential aspirations while harshly criticizing Mr. Trump.

Mr. Strzok was the agent running the investigation into Mrs. Clinton's use of a private email server while secretary of state. He also was briefly a member of special counsel Robert Mueller's team investigating suspected links between Russia and Mr. Trump's presidential campaign.

The agency's embarrassment over the situation was heightened last month when it admitted that it had lost nearly five months of texts exchanged between Mr. Strzok and Ms. Page because of "misconfiguration issues."

It took the FBI's inspector general to recover the missing texts.

"How does the FBI - with the top cybersecurity technology in the world - go to the microphone and announce the texts are missing?" Mr. Wedick said. "That just gives everyone an insecure feeling that they have no idea what they are doing."

Mr. Schiliro said the bad publicity surrounding the bureau is a result of the actions of a few top-level officials.

"The working agents are out there every day, doing their job and leaving politics at the door," Mr. Schiliro said. "But perhaps Comey and others at the top allowed this to continue unimpeded."

John Ligato, who spent 20 years at the bureau, said it's up to Mr. Comey's successor to restore confidence.

"Wray just needs to clean house now," he said. "The FBI needs to heal and show everyone who the bad apples are."

Mr. Ligato accused Mr. Wray of being slow to act, noting that Mr. McCabe did not leave until accusations of slow-walking the Clinton email investigation surfaced and that Mr. Strzok was not transferred until his affair with Ms. Page was publicly disclosed.

"Just the affair allegations, which may or may not be true, would have been enough to have an agent suspended when I was at the bureau," he said.

The former agents believe arrests in high-profile FBI investigations could heal some wounds. But such announcements could take a while and may be overshadowed in the media by the political climate in Washington.

"A string of good news will impact the public," Mr. Schiliro said. "I guarantee you that discussion is going on in the director's office."