Former FBI deputy director Andrew McCabe wrote about his firing in an emotional opinion column in The Washington Post on Friday.

"Not in my worst nightmares did I ever dream my FBI career would end this way," he said.

McCabe rejected one of the main reasons for his dismissal from the bureau — a charge that he was not honest about his handling of disclosures to the media, an accusation that Attorney General Jeff Sessions described as a "lack of candor."

McCabe ended the column with an inspirational message for current members of the federal law-enforcement community. "The country needs you," he said.

Former FBI deputy director Andrew McCabe wrote about his firing in an emotional opinion column in the The Washington Post on Friday, one week after Attorney General Jeff Sessions dismissed him from the agency just hours before he was set to retire with a lifetime pension.

"Not in my worst nightmares did I ever dream my FBI career would end this way," McCabe wrote.

In his column, McCabe described how he learned of his firing, late at night, through a friend who had heard about it on the news: "Despite all the preparation for the worst-case scenario, I still felt disoriented and sick to my stomach," he said.

"So, after two decades of public service, I found out that I had been fired in the most disembodied, impersonal way — third-hand, based on a news account," McCabe wrote.

McCabe was dismissed for what was described as a "lack of candor" in the investigation surrounding his handling of disclosures to the media during the bureau's probe of Hillary Clinton's emails. McCabe pushed back on the assertion that he had been dishonest, calling it "not true."

"When asked about contacts with a reporter that were fully within my power to authorize as deputy director, and amid the chaos that surrounded me, I answered questions as completely and accurately as I could," McCabe said.

"And when I realized that some of my answers were not fully accurate or may have been misunderstood, I took the initiative to correct them."

McCabe acknowledged that, at worst, some of the statements he made at the time may have been unclear, "and for that I take full responsibility," he said.

"But that is not a lack of candor." he added.

The former deputy director took exception to the manner in which President Donald Trump responded to his firing. Trump celebrated it on Twitter last Friday, calling it "a great day for democracy." The president had engaged in months of public attacks on McCabe and his wife, a move that critics described as an effort to push McCabe out of the agency.

The reason, those critics said, could be related to the fact that former FBI director James Comey, who Trump fired in May last year, told McCabe and two other top FBI officials about his conversations with Trump that may be germane to an obstruction-of-justice case special counsel Robert Mueller is building in the Russia investigation.

McCabe painted Trump as being out of touch with the rank-and-file of federal law-enforcement.

"I was sad, but not surprised, to see that such unhinged public attacks on me would continue into my life after my service to the FBI," McCabe continued. "President Trump’s cruelty reminded me of the days immediately following the firing of James B. Comey ... the president’s comments about me were equally hurtful and false, which shows that he has no idea how FBI people feel about their leaders."

McCabe ended his column with an inspirational message to current FBI officials and people who were interested in a career in law-enforcement: "To those men and women, I say: Fear not. Set the headlines aside and give in to what draws you to this work. The country needs you."

"There is nothing like having the opportunity to be a part of the greatest law-enforcement organization in the world, working every day for goals that you respect and cherish. It is the best job you will ever have."