The judge who has been overseeing Bill Cosby's criminal case since its beginning is staying on the case.

Montgomery County Court of Common Pleas Judge Steven T. O'Neill filed an order and opinion Wednesday denying Cosby's motion for disclosure and recusal. Cosby is to be sentenced next week.

O'Neill also ruled in an order Thursday that prosecutors may not produce evidence of “uncharged criminal acts” at sentencing. At trial, prosecutors were allowed to present testimony of other women who Cosby allegedly assaulted. But O'Neill said he found no authority in Pennsylvania that would allow him to consider uncharged conduct in deciding Cosby's sentence.

Lawyers for Cosby had argued in a motion filed earlier this month that O'Neill should make “disclosures regarding prior interactions” with former Montgomery County District Attorney Bruce Castor, asking the court to vacate its 2016 ruling on Cosby's petition for writ of habeas corpus and arguing that O'Neill should recuse from the case.

The motion referred to a March 2018 article in Radar Online, which Cosby's lawyers described as “an internet gossip site,” describing a purported dispute between Castor and O'Neill when they were both running to be district attorney.

O'Neill said the motion was untimely, given that Cosby's representatives knew about the alleged conflict between O'Neill and Castor months ago, and could have learned even earlier that the two ran against each other in a 1999 DA election. And aside from the timing, Cosby's motion was meritless, O'Neill said, contending he has had no bias against any witness in the case, or Cosby himself.

“Not once during his tenure as district attorney was Mr. Castor, or anyone else, heard to ascribe some sort of 'grudge' or prejudice against Mr. Castor in any criminal matter that came before this court,” O'Neill wrote. “Likewise, since 2009, Mr. Castor has, on occasion, appeared before this court as a criminal defense attorney and has never sought disclosure or disqualification of the court because of some perceived bias or 'grudge' against him.”

Cosby filed the habeas corpus petition in early 2016, 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 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.

The Montgomery County District Attorney's Office declined to comment on O'Neill's order. In a filing last week, Steele called the recusal motion “an effort to avoid accountability and avert a long overdue day of reckoning.”

Joseph P. Green, Cosby's attorney, did not return a call for comment.

READ MORE: