A lawyer for Andrew McCabe indicated Tuesday that the former Deputy FBI director would be willing to exchange his testimony for immunity from prosecution.

Here's what happened

McCabe was fired from his position in March and released a scathing letter criticizing the president for undermining the authority of law enforcement institutions.

“This attack on my credibility is one part of a larger effort not just to slander me personally,” he said in the statement, “but to taint the FBI, law enforcement, and intelligence professionals more generally."

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

In April a report from the Inspector General of the Justice Department accused McCabe of lying "on multiple occasions to multiple investigators, first the leak investigators at the FBI, and then following that to his boss Director Comey, he told him he was not the source of this leak to the Wall Street Journal, and then ultimately with the Inspector General as well.”

"A textbook case for granting" immunity

Tuesday he asked for immunity in exchange for his testimony.

"Mr. McCabe is willing to testify, but because of the criminal referral, he must be afforded suitable legal protection," McCabe attorney Michael Bromwich wrote to Senate Judiciary Chairman Chuck Grassley (R-Iowa).

"This is a textbook case for granting use immunity," he continued. "If this Committee is unwilling or unable to obtain such an order, then Mr. McCabe will have to no choice but to invoke his Fifth Amendment privilege against self-incrimination."

"McCabe was totally controlled by Comey"

President Trump has attacked McCabe often, especially from his Twitter account.

"Andrew McCabe FIRED, a great day for the hard working men and women of the FBI," he tweeted after McCabe was let go. "A great day for Democracy."

"DOJ just issued the McCabe report - which is a total disaster," he tweeted in April. "He LIED! LIED! LIED!"

Allies of the president have alleged that McCabe was cooperating with the "deep state," an alleged organization of Obama holdovers in the government that were acting secretly to undermine Trump's policies and his presidency.