President Donald Trump fired FBI Director James Comey Tuesday. And the ostensible reason is to defend Hillary Clinton.

The firing was announced in a brief statement from White House press secretary Sean Spicer:

Today, President Donald J. Trump informed FBI Director James Comey that he has been terminated and removed from office. President Trump acted based on the clear recommendations of both Deputy Attorney General Rod Rosenstein and Attorney General Jeff Sessions. “The FBI is one of our Nation’s most cherished and respected institutions and today will mark a new beginning for our crown jewel of law enforcement,” said President Trump. A search for a new permanent FBI Director will begin immediately.

A memo from Deputy AG Rosenstein (as well as letters from Sessions and Trump) was also released to the public. In the memo, Rosenstein makes it clear that Comey is being fired because of his handling of the 2016 investigation of Clinton’s use of a private email server as secretary of state.

“I cannot defend the Director’s handling of the conclusion of the investigation into Secretary Clinton’s emails,” Rosenstein wrote, “and I do not understand his refusal to accept the nearly universal judgment that he was mistaken.”

In June 2016, Comey held a press conference to announce that he was not recommending charges be filed against Clinton. The move was extremely unorthodox — both because Comey was doing it instead of then-Attorney General Loretta Lynch, and because Comey characterized Clinton’s actions as “extremely careless” even while saying they weren’t criminal. The effect, critics noted at the time, was to make it seem like Clinton had done something against the law.

Compounding that impression, Comey then reopened the investigation in October 2016, days before the election, upon discovering a previously unexamined cache of emails on the laptop of former Congress member Anthony Weiner (whose wife, Huma Abedin, was a close Clinton aide). The emails were mostly discovered to be duplicates. Comey’s actions are still blamed among Democrats (including Clinton herself) for contributing to Trump’s win.

The Clinton email issue has remained a problem for Comey. As recently as Tuesday, the day he was fired, the FBI sent a letter “supplementing” Comey’s testimony from last week before a Senate committee — after reports came out that Comey had made false statements about Abedin’s use of email.

It is, to put it mildly, extremely uncharacteristic of the Trump administration to take a stand on behalf of the opponent the president still occasionally calls “Crooked Hillary.” While there’s no other issue mentioned in Rosenstein’s memo, the FBI also has an ongoing investigation into possible ties between the Trump campaign and the Russian government.

Comey confirmed the existence of such an investigation in March. The Trump administration has been extremely eager to dispel any hint of wrongdoing or collusion. In President Trump’s letter firing Comey, he says he appreciates Comey telling him “on three separate occasions” that Trump himself is not under investigation; that reference could be a stray bit of Trumpian humor, or a hint that Comey ran afoul of the president for reasons that have nothing to do with Hillary Clinton.