Image copyright AP Image caption Bill Cosby's lawyers are attempting to get the case thrown out

A key piece of evidence in the sex assault case against Bill Cosby has been called into question, according to reports.

An email seen by CNN alleges that a prosecutor promised Mr Cosby's deposition in a 2005 civil case would not be used to bring criminal charges.

In the deposition, Mr Cosby admitted drugging women during sexual encounters but said it was by mutual consent.

The deposition now forms the basis of an aggravated indecent assault charge.

Mr Cosby has denied the charge and his lawyers will now use the immunity claim to get the case in dismissed.

Former Montgomery County district attorney Bill Castor was in charge when Andrea Constand sued Mr Cosby in a civil sex assault trial in 2005, after no criminal charges were brought. Mr Cosby settled the case for an undisclosed sum.

Mr Castor, according to CNN, agreed that Mr Cosby's civil deposition would not be used to bring criminal charges.

Image copyright AP Image caption Andrea Constand says she was assaulted by Mr Cosby in 2004

However, the current district attorney, Kevin Steele, said there is no evidence of a signed immunity agreement, which would have had to go through agreed channels.

On Saturday, Andrea Constand's lawyer said she never knew of such an agreement, the Associated Press news agency reported.

'No agreement'

During the civil claim deposition, Mr Cosby admitted giving Ms Constand wine and pills but said she consented to take them. He also admitted paying off other women to keep them quiet.

Writing to his successor, Risa Vetri Ferman, three months before criminal charges were filed, Mr Castor said: "I can see no possibility that Cosby's deposition could be used in a state criminal case, because I would have to testify as to what happened, and the deposition would be subject to suppression.

"I cannot believe any state court judge would allow that deposition into evidence. ...Knowing this, unless you can make out a case without that deposition and without anything the deposition led you to, I think Cosby would have an action against the County and maybe even against you personally."

It is now believed Mr Castor will be called by Mr Cosby's lawyers at a hearing on 2 February, where they will attempt to get the charge dismissed.

But the current district attorney, Kevin Steele, said there is no evidence of a signed immunity agreement, which would have had to go through agreed channels.

It was the decision of Mr Steele to bring criminal charges in December, before the statue of limitations ran out in January.

Dozens of women have accused Mr Cosby of sexual assault, dating back to the 1970s, but only one charge has been brought because of the statute of limitations has passed on the majority of claims.