Former Montgomery County, Pa., District Attorney Bruce Castor is fending off a heap of criticism from many who believe him to be the reason Bill Cosby is walking about as a free man after serving two years of a three-to-10-year sentence for alleged sexual assault.

On Wednesday, the Pennsylvania Supreme Court threw out the 83-year-old disgraced actor’s conviction for sexual assault after finding that District Attorney Kevin Steele, the prosecutor who brought the case against Cosby, violated an agreement to not charge him. The deal that was apparently in place was cut by then-District Attorney Castor in 2004 and according to the court, was an agreement that Cosby would not be prosecuted if he entered a deposition despite the deal having never been put in writing.

The former district attorney, who also represented Donald Trump in the former president’s second impeachment trial, joined Fox News on "America Reports" and explained his reasoning behind the decision to make the deal with the embattled stand-up performer, telling John Roberts that what is being reported in the media isn’t at all how the situation played out.

"I made a decision not to prosecute Cosby, and I made that decision on behalf of the Commonwealth intending to bind the Commonwealth as a result of that, as a matter of law, he lost his ability to claim the Fifth Amendment privilege against self-incrimination when he was required to testify at the civil case and give four depositions that I understand he leveraged – or the other side there, the plaintiff leveraged into a multimillion-dollar settlement. So there is no – I didn't need any agreement from him," Castor explained.

WHAT’S NEXT FOR BILL COSBY AFTER SEX ASSAULT CONVICTION OVERTURNED

He continued: "It was the decision I made. And I did it with the specific intent of removing him from having the ability to invoke the Fifth Amendment so that I could get some measure of punishment because as a criminal matter, there wasn't enough evidence to arrest and prosecute Cosby. There wasn't enough evidence in 2005, and there isn't enough evidence today."

The attorney maintained that back in 2005, he had "two choices" at his disposal as it related to Cosby.

"I could do nothing and hope the case got better or I could try to set the board up so that civil lawyers who knew what they were doing could make a good civil settlement for the woman who complained, I chose to do something rather than nothing."

BILL COSBY'S ACCUSERS CARLA FERRIGNO, JANICE DICKINSON AND MORE REACT TO HIS PRISON RELEASE: 'I’M ANGRY'

When probed about the verbiage of a "deal" having been stricken with Cosby, Roberts cited the Supreme Court justices who recognized that an "unconditional promise" had been given to the former Huxtable patriarch to not prosecute Cosby. 

Castor took slight umbrage with the language used by Roberts in his defense of the decision he made not to bring charges against Cosby.

"No, John, you're not using the words correctly," Castor responded. "I promised on behalf of the Commonwealth not to prosecute Cosby, but that's not an agreement. [Cosby] doesn't have – he gets no say in that. I decide that."

"An agreement requires that he gets some say in it," Castor continued. "See, I didn't get anything back from him. What I said was, on behalf of the Commonwealth, we will not prosecute you, because I knew as a matter of law that once that was cemented, Cosby could no longer claim that anything he said could incriminate him and it required him then to testify. So there's no deal. There's no agreement. It was a promise on behalf of the Commonwealth. So the majority got it right and Justice [Thomas] G. Saylor disagreed. Now, Justice Saylor was one of seven and the other six agreed, evidently with the majority opinion and even Justice Saylor thought the case should be reversed. He just would have done it on different grounds. So literally, the government lost seven to nothing."

BILL COSBY'S TREATMENT IN PRISON REVEALED AS DISGRACED ACTOR'S SPOKESMAN ADMITS WIFE DID NOT VISIT HIM ONCE

Elsewhere in the interview, Roberts asked Castor if he felt the subsequent district attorney violated Castor’s promise not to prosecute in perpetuity to which Castor said, yes – as it was the only way Castor "could be sure that the shield of self-incrimination was stripped away from Cosby."

"So the only way to guarantee in the law that a person claiming the Fifth Amendment will be unable to do so is if there's no chance that what he says could ever be used against him. So, yes, I intended that to bind my successors in perpetuity," Castor told Roberts. 

x-default

Bill Cosby performs at the Maxwell C. King Center for the Performing Arts on Nov. 21, 2014, in Melbourne, Fla. (AP, File)

"But you do understand, of course, John, the case still hadn't improved," he sustained. "I mean, what I did was I took a case that I didn't have enough evidence to win and I found another solution to get a positive outcome for the complaining witness. To this day, the case hasn't gotten any better. And just because 80 people came forward and said that they were molested by Bill Cosby, they didn't go to the police and press charges and that evidence is not admissible."

BILL COSBY RULING COULD HAVE CHILLING EFFECT ON SURVIVORS, SEXUAL ASSAULT VICTIM ADVOCATES SAY

"So I go back to 2005 – I don't have enough evidence to arrest. I can sit there, do nothing and hope the case gets better, like get a confession – or I can try to find another way, another solution," Castor persisted. "And I chose that to find another way because I didn't think he was going to confess."