Days before the long-awaited courtroom showdown between Bill Cosby and his accuser Andrea Constand, the trial judge rejected a request by Cosby's lawyers to question her on the witness stand about her sexual past — including an alleged relationship with another celebrity.

The star was referred to only as a "male celebrity athlete" during a June 1 closed-door session between lawyers and the judge, according to a transcript of the meeting obtained Thursday by the Inquirer and Daily News. (Defense court filings made public Friday elaborated only slightly, identifying him as a "superstar professional basketball player.")

"We believe that this tells a very interesting story about what the heck is going on here," defense lawyer Brian McMonagle told Montgomery County Judge Steven T. O'Neill, according to the transcript. "I'm assuming [detectives] tried to see whether or not this was a pattern on her part of chasing celebrities."

Prosecutors countered that the tactic not only amounted to unfair harassment of Constand but that any mention of her relationship went beyond the bounds of Pennsylvania's Rape Shield Law, which protects alleged sex-crime victims from having their sexual pasts picked apart in court.

Cosby's "intention to engage in the age-old tactic of victim shaming is clear," District Attorney Kevin R. Steele argued in a written response to the defense request. "There exists absolutely no logical connection between the defendant's guilt and Ms. Constand's relationship status, her sexual orientation, or her past partners."

O'Neill agreed.

Both sides refused this week to disclose the identity of the celebrity athlete when asked by the Inquirer and Daily News. Constand's lawyer, Dolores Troiani, declined to comment.

The earlier relationship was  uncovered by Montgomery County detectives as part of their 2005 investigation of Constand's sexual assault claims, the records show.

McMonagle had argued that Constand's past dalliances with the unnamed luminary were significant because her own lawyers have noted in separate civil litigation that their client is gay and therefore would have no romantic interest in Cosby.

During the criminal trial, lawyers on both sides have avoided any mention of Constand's sexual orientation.

Few details about the relationship with the unnamed athlete were outlined in the transcript or in Steele's filing, which accused the defense of trying to "harass, abuse, embarrass and humiliate" the only woman among dozens of Cosby accusers whose allegations have resulted in criminal charges.

The defense's court papers alleged that Constand initially told police the relationship began in July 1999 and lasted until just after Constand arrived in Philadelphia in 2001 for a job as the operations manager of Temple University's women's basketball team.

Constand, 44, told jurors this week that she had no romantic intentions toward Cosby and had to fend off repeated advances from him. She claims he drugged and assaulted her in 2004 at his Cheltenham home. Cosby maintains their sexual encounter was consensual.

O'Neill also blocked defense lawyers from mentioning Constand's on-again, off-again relationship with a woman around the same time.

Keep up with every development in Bill Cosby's case with our day-by-day recaps and explainer on everything you need to know about the case and its major players.