After Democratic presidential nominee Hillary Clinton’s election loss to Republican opponent Donald Trump on Tuesday night, FBI Director James Comey has become a target of widespread criticism, with pundits, legal analysts and politicians urging him to resign.

Comey led an investigation earlier this year into Clinton's use of a private email server while secretary of state. In July, he said that although she and her staff had been "extremely careless" with classified information contained in the messages, no charges were "appropriate" in the case.

However, when Comey announced via a letter to Congress less than two weeks before the election that he would reopen his investigation, many pointed out how politicized the inquiry had become.

“You don’t do this,” a former senior official from the Justice Department told the New Yorker’s Jane Mayer, adding that the decision was “aberrational” and “violates decades of practice” due to the fact that “it impugns the integrity and reputation of the candidate, even though there’s no finding by a court, or in this instance even an indictment.”

Another former official recalled an election season in which then-Attorney General Janet Reno kept an investigation of a “politically sensitive criminal target” under wraps so as not to distort the results with a potentially false image of wrongdoing, the New Yorker reported. And, this year, multiple officials within the Justice Department “did everything short of” stopping Comey from sending the letter to Congress, the New York Times reported on Oct. 29.

Days later, even outgoing President Barack Obama, while not describing Comey by name, appeared to disapprove of the director’s decision to publicize the case against Clinton.

“I do think there is a norm, that, when there are investigations, we don’t operate on innuendo, we don’t operate incomplete information, we don’t operate on leaks,” he said in an interview with NowThis. “We operate based on concrete decisions that are made.”

By early Wednesday morning, when Clinton had to concede to Trump, Comey had become the target of much Democratic ire. 

“It’s almost a crime… This will be the first line in his obit no matter what happens on Tuesday,” former special counsel to the House and Senate Judiciary Committees John Flannery said on CNN on Tuesday evening. “And instead of analyzing what he did that’s wrong, we should have him act to correct what he did that was wrong and these two letters that he did were not the answer. The answer is that he resigns by midnight tonight.”

In an editorial in the Boston Globe, columnist Michael Cohen pointed to the fact that the FBI had little knowledge of the significance of the new emails’ content, as the agency hadn’t yet obtained the warrant needed to read them.

“Why didn’t Comey wait until after the election to tell Congress — or at least wait until agents had a chance to review the emails?” Cohen wrote on Oct. 31, adding that Comey’s July comments on Clinton’s legal-but-risky use of the server were “prejudicial and inappropriate.” “Comey has a responsibility to ignore politics in this case. Instead he’s allowed it to dictate his actions.”

Mortimer Zuckerman, the chairman and editor-in-chief of U.S. News and World Report, expressed similar frustration with Comey’s comments in his written call for the FBI director to step down.

“It smelled somewhat of appeasement: We don’t like giving this verdict, so we will add a little smear for the benefit of those who have been clamoring to lock her up,” Zuckerman wrote, arguing that a “self-righteous” Comey “served his country badly.”

Others were more sympathetic to Comey, citing the dual and conflicting pressures of transparency and political neutrality.

“He got himself into a terrible situation where he thought he was doing the right thing when he was actually doing the wrong thing,” prominent legal scholar and commentator Alan Dershowitz responded to Flannery on CNN. "We should be pointing our finger at the right person:  It is Donald Trump who misinformed the American public and told them that Hillary Clinton would be indicted.”

In an online Oct. 30 op-ed, CNN legal analyst Paul Callan echoed Dershowitz’s fears, noting the importance of keeping public figures open and accountable. Still, he said, the “FBI rule book” had been “thrown on the trash heap this year.”

“In truth, investigations open and close routinely and secretly when new evidence comes to light,” wrote Callan. “Each new scrap in a pile of useful or useless evidence is not announced in real time, like a scandal in a scripted reality TV show. Perhaps it’s time for the embattled FBI director who seems to have forgotten how to conduct a proper investigation to resign.”

The last time an FBI director resigned was in May 2001, when then director Louis Freeh, plagued by a series of scandals, left the agency