Less than two weeks before he is to be sentenced, Bill Cosby wants the judge overseeing his case to step aside over an alleged personal conflict involving former Montgomery County District Attorney Bruce Castor Jr.

Lawyers for Cosby filed a motion Tuesday in the Montgomery County Court of Common Pleas seeking “disclosures regarding prior interactions with Bruce Castor,” asking the court to vacate its 2016 ruling on Cosby's petition for writ of habeas corpus and arguing that Judge Steven T. O'Neill recuse from the case.

Cosby was found guilty of three counts of aggravated indecent assault in April, based on Andrea Constand's allegations that he sexually assaulted her in 2004. His sentencing hearing is set to begin Sept. 24.

Cosby filed a petition for writ of habeas corpus shortly after charges were filed, arguing that his attorneys in 2005 had an enforceable agreement with the District Attorney's Office that he would not be prosecuted. Castor was district attorney at that time, and he made a public announcement when his office chose not to bring charges against Cosby based on Constand's allegations.

Current District Attorney Kevin Steele had reopened the case and brought charges after portions of a civil deposition Cosby gave in 2005 and 2006, in which Cosby admitted to giving a woman drugs in order to have sex with her, became public.

Castor testified at the hearing in February 2016 on that petition, and said he made a binding promise in 2005 that Cosby would not be prosecuted. But after two days of testimony and argument, O'Neill ruled in prosecutors' favor, denying Cosby's petition to have the charges dismissed. O'Neill's order said a credibility judgment was inherent in his ruling.

Cosby's lawyers want a new hearing on the petition, their latest motion said, with a new judge.

In the motion filed Tuesday, Cosby's lawyers pointed to a 2018 article in The National Enquirer, which had suggested that O'Neill held a grudge against Castor. That article led to further investigation by Cosby's attorneys, the motion said.

The motion alleged that Castor and O'Neill have a “hostile and acrimonious” relationship, dating back to when they campaigned against each other for the Republican nomination for Montgomery County district attorney in 1999.

“As applied to the assessment of Castor's credibility made by Judge O'Neill in resolving defendant's due process claims in 2016, these facts constitute information that 'the parties or their lawyers might reasonably consider relevant to a possible motion for disqualification or recusal, even if the judge believes there is no proper basis for disqualification or recusal,'” the motion said, asking the court to put on the record “the true facts of his interactions with Mr. Castor” during the 1999 campaign and leading up to it.

Cosby's lawyers also argued that O'Neill should revisit his recusal decision because he, rather than an impartial jury, will be the fact-finder at sentencing. Cosby has argued that O'Neill's impartiality is questionable because his wife is a social worker who works with sexual assault victims, and she has spoken publicly about issues surrounding sexual assault.

In a statement Tuesday, Steele said, “This defense filing is simply a desperate, 11th-hour attempt by Cosby's current set of attorneys to stop the sentencing of a convicted felon for his crimes. This motion reflects the fact that the defendant accepts no responsibility for his own actions. We will be filing a response.”

Castor did not immediately respond to a call for comment Tuesday.

READ MORE: