The Pennsylvania Supreme Court has agreed to consider Bill Cosby's efforts to overturn the sexual assault trial that resulted in a lengthy sentence for the famed comedian.

The justices on Tuesday agreed to hear Cosby's appeal, granting allocatur on two issues the former TV star has raised throughout the criminal proceedings against him.

The one-page order specifies that the justices will consider whether the trial court improperly admitted the testimony of several women who claimed Cosby sexually assaulted them decades ago, and whether a purported agreement between Cosby and a former Montgomery County district attorney to not press charges against the comedian in 2005 barred a subsequent administration from prosecuting Cosby nearly a decade later.

In the spring of 2018, a Montgomery County jury found Cosby guilty of three counts of aggravated indecent assault, based on Andrea Constand's allegations that he sexually assaulted her in 2004. He was ultimately sentenced to three-to-10 years in state prison.

In December, a three-judge Superior Court panel denied Cosby's efforts to overturn that verdict, saying, in a 94-page opinion, that the comedian's sentence should stay in place.

Cosby's case raised unusual questions given the large number of additional accusers, and a purported nonprosecution agreement from when the allegations against him first surfaced. But the appellate court stood by the Montgomery County Court of Common Pleas' decisions on those issues.

A main focus of Cosby's appeal, among other arguments, was that the trial court erred in allowing five women who have accused him of sexual assault to testify at trial, in addition to Constand, whose allegations against him formed the basis of the criminal case. Cosby was found guilty of drugging Constand and sexually assaulting her at his home in 2004.

Another recurring issue in the prosecution, which is set to now come before the justices, stems from an alleged agreement he entered into with prosecutors more than a decade ago.

Shortly after the charges against him were filed, Cosby filed a petition for writ of habeas corpus, arguing that his attorneys in 2005 had an enforceable agreement with the District Attorney's Office that he would not be prosecuted in exchange for Cosby testifying in a related civil lawsuit. Bruce L. Castor Jr. 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 reopened the case and brought charges after portions of the 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 a hearing in February 2016 about 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, Judge Steven T. 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.

In addition to pointing to the agreement as part of his appeal, Cosby's defense team also cited it in an effort to recuse O'Neill from overseeing his sentencing.

In a statement to the press, Steele said, "The Pennsylvania Supreme Court has narrowed the issues on appeal, limiting them to prior bad acts and the sovereign edict. We look forward to briefing and arguing these issues and remain confident in the trial court and Superior Court's previous decisions."

Brian Perry of Perry Shore Weisenberger & Zemlock, who is representing Cosby, did not immediately returned a call seeking comment.