A Philadelphia judge has dismissed Bruce L. Castor Jr.'s lawsuit against Bill Cosby's accuser Andrea Constand, days before Constand is expected to testify at the entertainer's retrial on sex-assault charges.

Common Pleas Judge Ann Butchart this week granted a request from Constand and her lawyers to dismiss the lawsuit brought by the former Montgomery County district attorney and commissioner.

Castor's lawsuit is just one strand in the complex web of litigation that has loomed — or still looms — over Cosby and Constand as the trial opens in Norristown.

Castor, who as prosecutor in 2005 declined to charge Cosby in the alleged attack on Constand, filed the personal injury claim against her and her lawyers in October. He alleged that her federal defamation lawsuit against him was filed in 2015 as an attempt to influence that year's race for district attorney. Castor lost to Kevin R. Steele, the district attorney now leading the Cosby prosecution.

Still pending in federal court is Constand's lawsuit against Castor. Lawyers for both could not be reached for comment Thursday.

Montgomery County Judge Steven T. O'Neill has ruled that jurors cannot hear any mention of that litigation at the criminal trial. Opening arguments are scheduled to begin Monday.

The jury will be allowed, however, to hear about the lawsuit that Constand filed against Cosby in 2005 and their out-of-court settlement the next year — details that have not before been publicly disclosed.

On Thursday, prosecutors and Cosby's defense team completed jury selection,  choosing the six alternates who will only participate in deliberations if one of the original 12 panelists is removed.

During the fourth day of the process, the lawyers appeared more relaxed about whom they chose. The alternates include four men and two women. One, an African American man, said he couldn't guarantee that he would not be influenced by what he already had heard about the case, and another, a middle-aged white woman, said she thought Cosby was guilty. (The judge has sealed all the jurors names.)

Though O'Neill raised his eyebrows after that woman left the room, neither side asked to exclude her from the pool. She pledged that she could set aside her opinion and focus only on the evidence in the case.

"My thoughts are based on things that I've heard that I don't know are actually factual," the woman said.