Shortly before Election Day in 2016, Andrew McCabe made a decision that he says was within his authority as deputy director of the FBI. He chose to share with the Wall Street Journal information about two investigations related to Hillary Clinton, one focused on her family foundation and the other on her use of a private email server as secretary of state.

“I was being portrayed in the media over and over as a political partisan, accused of closing down investigations under political pressure,” McCabe said in a statement after his firing Friday. “The FBI was portrayed as caving under that pressure, and making decisions for political rather than law enforcement purposes. Nothing was further from the truth.”

McCabe added that he sought “to set the record straight on behalf of the bureau.”

Four months later, in the early days of the Trump administration, the White House asked McCabe to set the record straight in the media again, on a matter related to the law enforcement probe of election interference by Russia. This time, McCabe refused.

Attorney General Jeff Sessions cited McCabe’s disclosure to the Journal as a cause for termination, calling the action “unauthorized.” McCabe contends that his decision was “fully authorized under FBI rules.” In any case, McCabe had stepped down from his post in January and was set to officially retire Sunday, but he was abruptly dismissed about 26 hours shy of his eligibility for a full pension.

In trying to divine the Trump administration’s motive for such treatment, it is worth remembering not only the media disclosure McCabe did make but also the one he did not when the White House tried to enlist his help in combating bad press.

The occasion was a New York Times report on Feb. 14, 2017, that members of Trump’s presidential campaign “had repeated contacts with senior Russian intelligence officials in the year before the election.” CNN reported nine days later that the White House had reacted to the Times article by asking the FBI to publicly dispute it.

Sean Spicer, the White House press secretary at the time, confirmed the request at a subsequent media briefing and described how the episode unfolded.

“The FBI deputy director was at a meeting here at the White House that morning,” Spicer said, referring to McCabe. “After the meeting concluded, he asked the chief of staff to stand back a second; he wanted to tell him that the report in the New York Times was ‘BS.’ For viewers at home, I think you can pretty much figure what that means, but I'll leave it at that.

“At that time, the chief of staff said, ‘Thank you for sharing that with me. Can we let other people know that the story is not accurate?’ Throughout the day, they went back and forth to see what they thought was appropriate. Finally, [the FBI] came to the conclusion that they did not want to get in the process of knocking down every story that they had issues with.”

Four months later, after his own firing, former FBI director James B. Comey addressed the Times report under questioning in congressional testimony and said, “In the main, it was not true.” But he added that it is not the FBI’s custom to counter inaccurate news reports.

“We don’t call the press to say, ‘Hey, you got that thing wrong about this sensitive topic,’ ” Comey said. “We just have to leave it there.”

McCabe did not “leave it there” in October 2016. Referring to the Clinton Foundation probe, he said in his statement that he felt compelled to “make it clear that we were continuing an investigation that people in [the Obama Justice Department] opposed.”

The resulting Journal article, which did not identify McCabe as a source, described a conversation between McCabe and a senior Justice Department official who called “to voice his displeasure at finding that New York FBI agents were still openly pursuing the Clinton Foundation probe during the election season.” Here's a brief excerpt:

“Are you telling me that I need to shut down a validly predicated investigation?” Mr. McCabe asked, according to people familiar with the conversation. After a pause, the official replied, “Of course not,” these people said.

The message to the public was that the FBI is not influenced by politics. McCabe is now justifying his participation in the Journal article as an effort to defend the bureau’s reputation — and his own.

Whether he made the right call is up for debate; so is whether he should have similarly participated in an article in February 2017 to defend Trump’s reputation.

It is not hard to guess what the president thinks McCabe should have done.