President Trump said former FBI Director James Comey was one of the "rotten apples" at the FBI, after Comey accused Trump of spreading lies about his former agency.

“The FBI is a fantastic institution, but some of the people at the top were rotten apples. James Comey was one of them,” Trump told Fox News in an interview that aired Thursday. “I’ve done a great service to this country by getting rid of him, by firing him.”

Comey said on Twitter Wednesday that Trump's attacks on and lies about the FBI will cause “lasting damage” to the country.

“Facts matter. The FBI’s use of Confidential Human Sources (the actual term) is tightly regulated and essential to protecting the country. Attacks on the FBI and lying about its work will do lasting damage to our country. How will Republicans explain this to their grandchildren?” Comey tweeted.

The former FBI director was responding to a series of tweets from Trump about “spygate,” the name given by the president to revelations the FBI worked with a confidential informant during its investigation into Russian meddling in the 2016 election.

The informant, identified as academic Stefan Halper, met with three members of the Trump campaign.

When asked to respond to Comey’s tweet, Trump accused his former FBI director of being deceitful.

"How is he going to explain to his grandchildren all of the lies, the deceit, all of the problems he has caused for this country?" the president said. "I think a thing that I have done for this country, the firing of James Comey is going to go down as a very good thing."

Trump fired Comey in May 2017.