NORRISTOWN, PA — For years, Bill Cosby and the lanky former professional women’s basketball player who had accused him of sexual assault shared a secret.

They’d made a deal — a deal that required them both to keep their mouths shut. According to their arrangement, they would have to keep quiet about the substance of the allegations, but also about the price of that pact — the settlement that Cosby’s accuser, Andrea Constand, received to end her lawsuit against the legendary comedian.

On Monday, during opening statements in Cosby’s retrial on charges of sexually assaulting Constand, a state prosecutor formally wiped away that vow of secrecy, revealing for the first time that the entertainer paid his accuser $3,380,000 to end their dispute in 2006.

The settlement, which was not revealed in Cosby’s first trial before it ended last June with a hung jury, plays a pivotal role for both sides as the 80-year-old comedian returns to the courtroom. The defense hopes to use the settlement to cement a version of events in which Constand is a greedy schemer who lied to extract money from a wealthy celebrity. The prosecution, if it hopes to prevail, will have to persuade jurors to look past the seven-figure deal and focus instead on Constand’s accusation that Cosby abused his role as her mentor and tricked her into taking a sedative that so thoroughly immobilized her that she was unable to fend off his sexual advances.

“This case is about trust,” Montgomery County District Attorney Kevin Steele told the jury. “This trust is about betrayal.”

The timeline of the case has always been a challenge for the prosecution, and some jurors stared with quizzical looks on their faces as Steele sought to make sense of a complicated chain of events. The case stretches back to a night in January 2004 when Constand, who’d met Cosby while working as an operations director for the Temple University women’s basketball team, says the comic legend drugged and sexually assaulted her at his suburban Philadelphia home.

Constand, who is more than three decades younger than Cosby, didn’t report the alleged assault until a year later. She filed a lawsuit after another district attorney declined to prosecute Cosby.

Before that case was settled, Cosby gave extraordinary deposition testimony, saying he gave Constand pills and describing their sexual encounter. That testimony remained secret until 2015 when parts of Cosby’s deposition was released publicly by a federal judge overseeing lingering legal disputes that stemmed from Constand’s accusations.

Steele said prosecutors in his office reviewed the deposition, and decided to reopen the investigation.

“Andrea Constand didn’t come to us,” Steele said. “After this gets released, we go to her.”

Steele’s opening statement followed a strange day at the courthouse, where much of the action took place behind closed doors. Judge Steven T. O’Neill interviewed the seven men and five women on the jury, as well as six alternates, after bias concerns were raised by the defense.

Defense attorneys, who are scheduled to present their opening statement on Tuesday, had attempted Monday to have one member of the jury removed because a prospective juror who was not chosen said he’d told her that he believed Cosby was guilty. The judge, however, ultimately opted not to remove the juror.

Outside the courthouse, the action was rowdier and more transparent. Nicolle Rochelle, an actress who appeared on “The Cosby Show” as a 12-year-old, leaped into the path of the aging comedian as he was walking up to the courthouse. She had stripped naked to her waist. On her bare upper body, she had written the names of more than 60 women who have publicly accused Cosby of sexual misdeeds.

She didn’t get far. Several heavily armed sheriff’s deputies wrestled her into a bush and cuffed her. A woman on Cosby’s public relations team gave the protester a side-eye glance. Then Cosby was back on his way to meet the men and women who will decide his fate.