This article comes from the editorial staff of the LawNewz.com, a new Abrams media website covering law and crime. launching soon.

If former Pennsylvania District Attorney Bruce Castor made a promise not to prosecute Bill Cosby in 2005, this could doom prosecutors in the sexual assault case filed against him in December.

Here’s why.

Cosby’s attorneys say he ONLY agreed to testify in a sexual assault civil case based on this prosecutorial promise. You would expect, at the time, if Cosby’s attorneys thought he might be charged criminally in connection with that case, that they would have advised their client to invoke his right not to incriminate himself. They would have been crazy not to do so.

Instead, Cosby testified – describing in detail his various sexual encounters with young women and use of drugs – which he claimed were (basically) consensual. And now, those very admissions by Cosby, are the heart of the criminal case brought by Kevin Steele, the newly elected Montgomery County district attorney. (Side note: Steele was elected based on a campaign promise to prosecute Cosby)

“The bottom line is if it’s true that Bruce Castor made a promise not to prosecute, then it should be binding on the new district attorney,” said Beth Karas, LawNewz.com’s Editor-at- Large, “If the court doesn’t dismiss the charges, then it should grant the defense request to disqualify the Montgomery County District Attorney or tell prosecutors they can’t use Cosby’s testimony from the civil proceeding or any leads derived from it.”

In 2005, Castor, who was the Montgomery County District Attorney, declined to prosecute the entertainer, finding he didn’t have enough to support Andrea Constand’s claims. But — and this really complicates things — Castor’s office, at the time, issued a press release that “cautions all parties to this matter that he will reconsider this decision should the need arise.”

Constand, who was a Temple University basketball manager, told police in 2005, that Cosby drugged her and sexually assaulted her in his Pennsylvania home in 2004.

But here’s what could be the game changer. Since the 2005 press release, Castor has hinted that he made some sort of arrangement with Cosby in 2005. For example, he told a reporter at the Philadelphia Inquirer this in July:

“The best thing to do was to create an atmosphere that they [Constand and her attorneys] have the best opportunity to sue.” “What I actually thought was that he would be deposed and then there’d be a (civil) trial” and everything would come out.

Cosby’s attorneys claim that the recent charges “violate an express agreement made by the Montgomery County District Attorney in 2005, in which the Commonwealth agreed that Mr. Cosby would never be prosecuted with respect to the allegation of sexual assault.”

This will likely be a major sticking point in Cosby’s criminal case. His attorneys have already said they plan to call Castor as a witness. If he testifies he made this promise, Cosby would have a good chance of getting the deposition excluded and the charges dismissed.

“If Bill Cosby relied on a non-prosecution promise, then I don’t see how this case can go forward. At a minimum the state shouldn’t be able to use Cosby’s statement from his testimony. But this assumes there is proof of a binding non-prosecution agreement.” Karas said.

LawNewz founder Dan Abrams agreed on Twitter:

Cosby motion is serious. If former DA admits he assured Cosby defense that case would never be prosecuted, charges could end up dismissed — Dan Abrams (@danabrams) January 12, 2016

This is an opinion piece. The views expressed in this article are those of just the author.