PHILADELPHIA -- Bill Cosby's lawyers argued in an appeals filing Thursday that it was "fundamentally unfair" to let prosecutors use Cosby's damaging deposition from a sex accuser's lawsuit against him at trial.

Cosby believes he had a binding promise from a prosecutor that he could never be charged in the case, and said testimony from five other accusers about encounters that took place years -- or even decades -- earlier had improperly prejudiced the jury against him.

A spokeswoman for the Montgomery County district attorney's office declined comment but said prosecutors would file a response in the coming month.

Cosby, 83, is serving a three- to 10-year prison term after the jury in his 2018 sex assault trial convicted him of three counts of felony sex assault over a 2004 encounter with accuser Andrea Constand.

The filing claims a deposition by Cosby regarding the use of Quaaludes and allegations of uncharged sexual misconduct with about a half-dozen women "was irrelevant evidence that served no legitimate non-propensity purpose."

Cosby's lawyers argued those incidents occurred too long ago, in some cases going back to the 1970s, and that they lacked "any striking similarities" or comparable facts to the crimes he was tried for.

A former prosecutor had declined to prosecute Cosby when she went to police in 2005. However, another prosecutor reopened the case in 2015 after The Associated Press successfully petitioned a federal judge to unseal filings in the lawsuit she filed against him, including Cosby's deposition testimony about a string of sexual encounters with young women over the years and his admission that he had gotten Quaaludes to give women before sex.

Montgomery County Judge Steven T. O'Neill allowed one other accuser to testify for the prosecution at Cosby's trial in 2017, when the jury deadlocked, and five when he was tried and convicted at a retrial the following year.

"The time-honoured prohibition on bad character evidence was effectively dismantled at Cosby's trial," when the court allowed "decades-old, uncharged allegations of sexual misconduct," lawyer Jennifer Bonjean wrote in the appeal filing.

Cosby said he relied on prosecutors' promises not to bring charges when he gave the deposition despite the constitutional right not to incriminate himself.

"Although the evidence was purportedly allowed for a limited purpose, the prosecution's closing argument shows that the jury was urged to return a verdict against Cosby based on a depiction of him, unsupported by actual evidence, as a predator who drugged and raped women for decades," Cosby's new filing said.

The result, defence lawyers argued, was a violation of "Cosby's right to be tried on the crimes charged, rather than on an indictment of his entire life."

The filing noted that Cosby's lawyers have not turned up a previous Pennsylvania case that directly addresses whether one prosecutor can make an unwritten promise not to prosecute that their elected successor must honour.

"Fundamental fairness and principles of due process" mean that promise was binding on Montgomery County prosecutors, Cosby's lawyers argued.

In June, Pennsylvania's highest court agreed to review those two issues, overturning a lower court that had rejected Cosby's appeal.

Cosby has been imprisoned in suburban Philadelphia for nearly two years.