Washington (CNN) Former Deputy FBI Director Andrew McCabe is speaking out about his recent firing, saying the allegations of "lack of candor" against him are "not true."

"I have been accused of 'lack of candor.' That is not true. I did not knowingly mislead or lie to investigators," McCabe said in an op-ed published by The Washington Post.

McCabe also warned against partisan attacks on the agency, voicing concerns that it could "dissuade" young people from entering jobs based on public service.

"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," he wrote.

Following his firing, McCabe said in a statement that the move was part of a bigger effort to discredit the agency and law enforcement amid investigations into Russian meddling in the US election, where special counsel Robert Mueller is looking at any potential ties with the Trump campaign.

"This attack on my credibility is one part of a larger effort not just to slander me personally, but to taint the FBI, law enforcement, and intelligence professionals more generally," McCabe said in a statement. "It is part of this Administration's ongoing war on the FBI and the efforts of the Special Counsel investigation, which continue to this day. Their persistence in this campaign only highlights the importance of the Special Counsel's work."

Hours after it was announced McCabe had been fired, President Donald Trump took to Twitter to celebrate, where he wrote: "Andrew McCabe FIRED, a great day for the hard working men and women of the FBI - A great day for Democracy. Sanctimonious James Comey was his boss and made McCabe look like a choirboy. He knew all about the lies and corruption going on at the highest levels of the FBI!"

In the piece posted Friday evening, McCabe also described how he learned of his firing, which he said was through a friend who called him after news reports broke that he had been let go.

"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 said in the op-ed. "Shortly after getting word, I noticed an email from a Justice Department official in my work account, telling me that I had been "removed from the Federal Bureau of Investigation and the civil service."