Former FBI Director James Comey believes that when he offers Congress assurances about an ongoing investigation, and those claims cease to be true, he has a duty to correct the record. His willingness to act on that belief may well have tipped the 2016 election to Donald Trump. And, it turns out, that unwavering stand is also what led Donald Trump to fire him.

Comey’s statement to the Senate Intelligence Committee, released on Wednesday ahead of his testimony, tells the story in dramatic fashion. At its heart is a clash between a president who insists he’s being smeared and demands to be defended, and a lawman who refuses to repeat in public the assurances that he offered in private.

That conflict played out most clearly in a March 30 phone call between the two. Trump, as Comey tells the story, described the Russia investigation as “a cloud” hovering over his presidency, and demanded to know what the FBI could do to “lift the cloud.” Comey insisted that a thorough, fair, and impartial investigation was the best way to resolve the matter.

But that didn’t placate the president, who wanted an explanation of Comey’s testimony the previous week confirming the existence of an investigation into the potential for collusion between Russia and associates of the Trump campaign. “I explained that we had briefed the leadership of Congress on exactly which individuals we were investigating and that we had told those Congressional leaders that we were not personally investigating President Trump,” Comey recalled. “I reminded him I had previously told him that. He repeatedly told me, ‘We need to get that fact out.’”

But Comey wouldn’t do it. He refused repeated, direct demands from the president that he say publicly what he had several times assured him in private—that the Bureau “did not have an open counter-intelligence case on him.” Comey said there were “a number of reasons” for his refusal, “most importantly because it would create a duty to correct, should that change.”

For Comey, “duty to correct” is a loaded phrase.

On July 5, 2016, Comey held a press conference to announce his conclusion that the investigation into Hillary Clinton’s emails should be closed without prosecution. In October, he learned that Anthony Weiner’s laptop contained thousands of emails from the account of Weiner’s wife, the Clinton aide Huma Abedin, and authorized his agents to examine them. Comey decided he had a “duty” to correct the “impression” he had left that the investigation was closed, according to The New Yorker, and announced on October 28 that he had reopened the investigation.

Others agreed. “He had an absolute duty, in my opinion, 11 days or not, to come forward with the new information that he has and let the American people know that, too,” then-Senator Jeff Sessions said at the time. Trump said “it took a lot of guts.”

Nate Silver of FiveThirtyEight has concluded that the Comey letter “probably cost Clinton the election”; Nate Cohn, of The New York Times, is more skeptical. But there’s little debate it had a major impact on the race. “It makes me mildly nauseous to think that we might have had some impact on the election,” Comey later told Congress.

So when Trump demanded that he publicly attest to the lack of an investigation, the bile surely rose again. But Comey said that he never explained to Trump his fear of again feeling a duty to correct, and there’s no evidence that Trump understood his rationale, or how Comey’s continued silence might ultimately protect him from a damaging public declaration.

To the contrary. “This Russia thing with Trump and Russia is a made-up story,” he told NBC’s Lester Holt, and he was reportedly infuriated that Comey would not publicly affirm that he was not under investigation.

When Trump fired Comey, his administration initially insisted that he was being dismissed for his handling of the Clinton investigation. But Trump’s own letter told a different story; he was evidently determined to tell the public what Comey would not. "While I greatly appreciate you informing me, on three separate occasions, that I am not under investigation, I nevertheless concur with the judgment of the Department of Justice that you are not able to effectively lead the Bureau," he wrote.

On Wednesday, Comey’s statement confirmed those three conversations, just as Trump had long demanded. But it also offered a detailed accounting of his interactions with Trump—contradicting the president’s claims on any number of crucial points.

It was as if Comey, once more, perceived a duty to correct the record.