President Donald Trump’s decision to fire FBI Director James Comey in 2017 was a pivotal moment for his presidency. The move, which came as the FBI began looking into Russia’s meddling in the 2016 election, helped fuel public calls for an independent special counsel that grew too loud to ignore.

Eight days after Comey’s firing, the special counsel investigation began. Two years later, the investigation’s findings released Thursday gave more details about exactly what happened when the president fired the head of the FBI. Here is what the Mueller report says about the incident.

Asking for loyalty

Trump’s relationship with Comey had been awkward from the beginning of his presidency, defined by the president’s requests that the FBI support him. The rocky relationship was known to the public at the time, as Trump vented his frustration over the investigation.

But the public didn’t know until after Comey was fired that the FBI head felt he had been repeatedly pressured to reassure the president that the FBI was not investigating him over the Russian election meddling. The lowest point came in the early months of 2017, when, according to Comey, the president invited him to a private dinner and told him that he needed loyalty from the FBI director. “I need loyalty, I expect loyalty,” he said. He asked Comey if he wanted to keep his job—something Comey interpreted as “an effort to create a patronage relationship.” Comey responded, “You will always get honesty from me.”

While this anecdote is still Comey’s word against Trump’s, the Mueller report makes it clear it finds Comey the more credible character—a remarkable conclusion and a blow to those who would argue that Comey was a politically motivated actor bent on smearing the president’s reputation.

Persuasion from Sessions

The idea that Trump should fire Comey apparently was planted after Comey testified before the Senate Judiciary Committee for an FBI oversight hearing on May 2, 2017. The president, upset over questions circulating about whether he was under investigation by the FBI, said “that it would be the last straw if Comey did not take the opportunity to set the record straight by publicly announcing that the President was not under investigation,” former White House counsel Don McGahn recalled, according to the report.

When Comey did not rule out Trump was being investigated, Trump turned on Sessions:

According to notes written by Hunt, the President said, “This is terrible Jeff. It’s all because you recused. AG is supposed to be most important appointment. Kennedy appointed his brother. Obama appointed Holder. I appointed you and you recused yourself. You left me on an island. I can’t do anything.”

Sessions then, according to the report, “stated at some point during the conversation that a new start at the FBI would be appropriate and the President should consider replacing Comey as FBI director.”

Steve Bannon, apparently a voice of reason in this situation, tried to dissuade Trump from firing Comey. Bannon told investigators that Trump had brought up the matter with him “at least eight times” on May 3 and 4.

According to Bannon, the President said the same thing each time: “He told me three times I’m not under investigation. He’s a showboater. He’s a grandstander. I don’t know any Russians. There was no collusion.” Bannon told the President that he could not fire Comey because “that ship had sailed.” Bannon also told the President that firing Comey was not going to stop the investigation, cautioning him that he could fire the FBI director but could not fire the FBI.

Why he did it

Trump was clear about one thing once he decided to fire Comey: He wanted to make sure everyone knew it wasn’t because he was being investigated. To get an ally in sending this message, he turned to adviser Stephen Miller, to whom he dictated a letter on May 5 that began with: “While I greatly appreciate you informing me that I am not under investigation concerning what I have often stated is a fabricated story on a Trump-Russia relationship—pertaining to the 2016 presidential election, please be informed that I, and I believe the American public—including Ds and Rs—have lost faith in you as Director of the FBI.”

After the two drafted a final letter, Trump brought it to McGahn and Reince Priebus. McGahn, in “an effort to slow down the decision-making process, … told the President that DOJ leadership was currently discussing Comey’s status” and went to talk to Sessions and Rosenstein. Both criticized Comey and agreed he should be fired. This gave McGahn and another White House attorney “peace of mind that the President’s decision to fire Comey was not an attempt to obstruct justice.”

McGahn then allegedly urged Trump to let Comey resign, but Trump refused. The president also wanted Rosenstein to include the Russia investigation in his recommendation to fire Comey.

According to notes taken by a senior DOJ official of Rosenstein’s description of his meeting with the President, the President said, “Put the Russia stuff in the memo.” Rosenstein responded that the Russia investigation was not the basis of his recommendation, so he did not think Russia should be mentioned. The President told Rosenstein he would appreciate it if Rosenstein put it in his letter anyway. When Rosenstein left the meeting, he knew that Comey would be terminated , and he told DOJ colleagues that his own reasons for replacing Comey were “not [the President’s] reasons.”

Even after Sessions sent Trump a less potentially compromising letter recommending Comey’s removal based his other actions, and even though the White House Counsel’s Office concluded that Trump’s original letter “should ‘[n]ot [see the] light of day,’” because it offered “other rationales,” Trump still ordered Miller to draft another letter including the assertion that Comey had told Trump he was not under investigation—over pretty much everyone’s objections.

White House lies

On May 9, the White House put out a statement with Sessions’ and Rosenstein’s reasoning for firing Comey. But still, Trump was unhappy with the press coverage of the firing. So that night, according to the report:

[T]he White House Press Office called the Department of Justice and said the White House wanted to put out a statement saying that it was Rosenstein’s idea to fire Comey. Rosenstein told other DOJ officials that he would not participate in putting out a “false story.” The President then called Rosenstein directly and said he was watching Fox News, that the coverage had been great, and that he wanted Rosenstein to do a press conference. Rosenstein responded that this was not a good idea because if the press asked him, he would tell the truth that Comey’s firing was not his idea. Sessions also informed the White House Counsel’s Office that evening that Rosenstein was upset that his memorandum was being portrayed as the reason for Comey’s termination.

White House press secretary Sean Spicer then told reporters late that evening that the firing “was all [Rosenstein].” Deputy press secretary Sarah Huckabee Sanders also lied about the nature of the firing, asserting the next day that “the rank and file of the FBI had lost confidence in their director” and that it was why Trump accepted Rosenstein’s recommendation to fire Comey. She reiterated that Rosenstein had decided “on his own” to come to the president to express his concerns. Trump later told Sanders she had done a good job at the press conference and didn’t point out any errors. Sanders told investigators that when she told a reporter she had heard from “countless members of the FBI” that they didn’t support Comey, it had been a “slip of the tongue.”

Two days later, after Rosenstein and Sessions complained to McGahn about the White House narrative, Trump went on NBC and told interviewer Lester Holt that he was going to fire Comey “regardless of recommendation” because of the Russia investigation.

That same day, the New York Times reported Comey’s allegations that Trump demanded he pledge his loyalty.