The Philadelphia defense lawyer who represented Bill Cosby in his sex assault trial wants to withdraw from the case, barely three months before the scheduled retrial.

Brian J. McMonagle, a well-known criminal lawyer in the Philadelphia area, asked permission to quit the case in a motion filed Tuesday with Montgomery County Judge Steven T. O'Neill. Cosby hasn't yet hired a new lawyer and wants until Aug. 21 to do so, McMonagle said in his petition.

In an email Tuesday, Cosby spokesman Andrew Wyatt said the search for a replacement is underway. "I'm vetting lawyers on my short list," he wrote, but declined to elaborate.

O'Neill has set an Aug. 22 court hearing to discuss McMonagle's withdrawal petition and other "outstanding issues," including where the jury would be selected for the retrial, scheduled to begin in November.

McMonagle led the defense team and delivered passionate opening and closing arguments at the entertainer's trial, which ended with a hung jury after 52 hours of deliberation in June.

But tension between McMonagle and the rest of Cosby's team appeared to grow throughout the lengthy jury deliberation. Wyatt, the publicist, talked to reporters on the Norristown courthouse steps almost every day, claiming the judge hadn't given Cosby a fair trial and declaring victory even as deliberations continued.

Minutes after O'Neill declared the mistrial, McMonagle and Wyatt argued heatedly over who would make a public statement and what they would say. McMonagle left the courthouse steps as Ebonee Benson, a colleague of Wyatt's, read a statement attacking O'Neill and District Attorney Kevin R. Steele.

Angela Agrusa, a Los Angeles-based lawyer, worked alongside McMonagle during the trial and cross-examined the prosecution's key witness, Andrea Constand, who alleges that Cosby drugged and molested her in 2004.

Agrusa hasn't asked to withdraw from the case. Wyatt said she "remains in place."

Cosby, 80, is charged with aggravated indecent assault. A retrial is scheduled to begin Nov. 6 in Norristown.