WASHINGTON — FBI director James Comey has been dismissed by the president, according to White House spokesman Sean Spicer — a startling move that officials said stemmed from a conclusion by Justice Department officials that he had mishandled the investigation of Hillary Clinton's emails.Comey was fired as he is leading a counterintelligence investigation to determine whether associates of President Donald Trump may have coordinated with Russia to meddle with the presidential election last year. That investigation began quietly last July but has now become the subject of intense debate in Washington. It is unclear how it will be affected by Comey's dismissal."The president has accepted the recommendation of the attorney general and the deputy attorney general regarding the dismissal of the director of the Federal Bureau of Investigation," Spicer told reporters in the briefing room.Spicer also said that Comey was "notified a short time ago." This is effective "immediately," he said.Officials said Comey was fired because senior Justice Department officials concluded he had violated Justice Department principles and procedures by publicly discussing the investigation of Hillary Clinton's use of private email. Just last week, Trump publicly accused Comey of giving Clinton "a free pass for many bad deeds" when he decided not to recommend criminal charges in the case.Officials released a Tuesday memo from Deputy Attorney General Rod Rosenstein, laying out the rationale behind Comey's dismissal."The FBI's reputation and credibility have suffered substantial damage, and it has affected the entire Department of Justice," Rosenstein wrote. "I cannot defend the director's handling of the conclusion of the investigation of Secretary Clinton's emails, and I do not understand his refusal to accept the nearly universal judgment that he was mistaken. Almost everyone agrees that the director made serious mistakes; it is one of the few issues that unites people of diverse perspectives."In a letter to Trump, Attorney General Jeff Sessions said that he agreed."I have concluded that a fresh start is needed at the leadership of the FBI," Sessions wrote. "I must recommend that you remove Director James B. Comey, Jr. and identify an experienced and qualified individual to lead the great men and women of the FBI."Shortly before the announcement, the FBI notified Congress by letter that Comey had misstated key findings involving the Hillary Clinton email investigation during testimony last week, but nothing about that issue seemed to suggest it might imperil Comey's job.The letter was sent to the Senate Judiciary Committee on Tuesday, more than a week after Comey testified for hours in defense of his handling of the Clinton inquiry."This letter is intended to supplement that testimony to ensure that the committee has the full context of what was reviewed and found on the laptop," wrote FBI assistant director Gregory Brower.In defending the investigation at last week's hearing, Comey offered seemingly new details to underscore the seriousness of the situation FBI agents faced last fall when they discovered thousands of Clinton aide Huma Abedin's emails on the computer of her husband, Anthony Weiner."Somehow, her emails were being forwarded to Anthony Weiner, including classified information," Comey said, adding later, "His then-spouse Huma Abedin appears to have had a regular practice of forwarding emails to him for him I think to print out for her so she could then deliver them to the secretary of state."RELATED STORY: Florida reacts to James Comey firingAt another point in the testimony, Comey said Abedin "forwarded hundreds and thousands of emails, some of which contain classified information."Neither of those statements is accurate, said people close to the investigation.Tuesday's letter said "most of the emails found on Mr. Weiner's laptop computer related to the Clinton investigation occurred as a result of a backup of personal electronic devices, with a small number a result of manual forwarding by Ms. Abedin to Mr. Weiner."The letter also corrected the impression Mr. Comey's testimony had left with some listeners that 12 classified emails were among those forwarded by Abedin to Weiner."Investigators identified approximately 49,000 emails which were potentially relevant to the investigation," the letter said. "All were reviewed with a particular focus on those containing classified information. Investigators ultimately determined that two e-mail chains containing classified information were manually forwarded to Mr. Weiner's account."Ten other emails chains that contained classified information were found on the laptop as a result of backup activity.The letter also clarified some of the figures Comey gave regarding ongoing terrorism investigations.The issue of Comey's misstatements was first reported by ProPublica.At the hearing, the statements about Abedin's email practices were immediately seized on by Sen. Ted Cruz, R-Texas, and others, who demanded to know why Abedin wasn't charged with a crime. Comey said it was difficult finding evidence those involved in Clinton's use of private email knowingly engaged in wrongdoing, and that traditionally the Justice Department has not prosecuted such cases without some indicator of intent.Comey's incorrect comments about Abedin surfaced again this week at a different Senate hearing, when Cruz pressed former director of national intelligence James Clapper Jr. to say how he would handle an employee who "forwarded hundreds or even thousands of emails to a non-government individual, their spouse, on a non-government computer."Clapper said such conduct "raises all kinds of potential security concerns."At the hearing last week, Comey spent hours defending his handling of the investigation of Clinton's use of a private server for work while she was secretary of state, saying it made him "mildly nauseous" to think his decisions might have affected the outcome of the presidential election, but insisting that he had no regrets and would not have handled it differently.Comey's decision-making during the Clinton inquiry has come under sustained criticism from Democrats — including Clinton — who say it was a major factor that contributed to her presidential election defeat in November to Donald Trump. On Oct. 28, less than two weeks before Election Day, the director notified Congress that new Clinton-related emails had been found on a laptop belonging to Weiner.Days later, investigators obtained a search warrant to examine about 3,000 messages on the device that were work-related. Of those, Comey said, agents found a dozen that contained classified information, but they were messages investigators had already seen.Comey's public comments about the Clinton case have been a source of public debate since he first announced last July that he would not recommend charges against anyone in connection with her use of a private server for government business.At the time, he called the use of the server "extremely careless" but said it did not rise to the level of a crime.The misstatements in testimony aren't the first time Comey has overstated a key fact in a high-profile probe.A year ago, while speaking at a security forum in London, the director miscalculated the price the FBI had paid for a technique to crack into a locked iPhone belonging to one of the dead suspects in a terrorist attack in San Bernardino, California.At the event, he said the cost of the phone hacking tool was "more than I will make in the remainder of this job, which is seven years and four months, for sure." Based on Comey's salary, his comment strongly implied the bureau paid at least $1.3 million to get into the phone, which belonged to Syed Rizwan Farook. Farook and his wife killed 14 people during a December 2015 terrorist attack.People close to that case said the FBI actually paid about $900,000.