NORRISTOWN, Pa. — A jury of seven men and five women will sit at the retrial of Bill Cosby on sexual assault charges, a court here decided on Wednesday.

After almost three days of jury selection, prosecutors and lawyers for Mr. Cosby agreed on the final member of the panel, a white man, ending a drawn-out process in which the defense team used all but one of its seven strikes. The jury selection was closely watched because Mr. Cosby’s previous trial on the same charges ended last summer with a hung jury unable to reach a verdict after six days of deliberation.

Jurors this time were asked whether they had formed opinions about Mr. Cosby’s guilt or innocence in the highly publicized case, whether they were already too influenced by the #MeToo movement and allegations of sexual misconduct in the entertainment industry, and whether they or a close family member had been a victim of a sexual assault.

Two of the 12 jurors — a man and a woman — are black; the rest are white. All are residents of Montgomery County, a predominantly white suburban area north of Philadelphia.