1 of 2
The Philadelphia Inquirer via AP, Pool, David Maialetti
Bill Cosby, left, leaves the courtroom during a break during a pretrial hearing in his sexual assault case at the Montgomery County Courthouse in Norristown, Pa., Tuesday, Dec. 13, 2016. Lawyers for Cosby will battle in court to try to limit the number of other accusers who can testify at the comedian's sexual assault trial.

NORRISTOWN, Pa. — Threatening to call in sheriff's deputies, a judge repeatedly admonished lawyers on both sides of Bill Cosby's sexual assault case Tuesday during a high-stakes hearing that will determine whether prosecutors can call as many as 13 accusers as trial witnesses.

Montgomery County Judge Steven O'Neill twice warned the lawyers to maintain decorum after courtroom shouting matches that centered on the defense team's practice of publicizing the names of the women accusing the comedian of sexual assault.

Prosecutors want to be allowed to put some of the accusers on the witness stand, a key part of their strategy to show that a sexual encounter at Cosby's suburban Philadelphia home in 2004 fit the 79-year-old entertainer's decadeslong pattern of drugging and molesting women.

Cosby's lawyers want the accusers barred from testifying at the spring trial, attacking their credibility and relevance.

The hearing, expected to last two days, was testy from the start.

District Attorney Kevin Steele clashed with Cosby lawyer Brian McMonagle over the defense's insistence on identifying accusers by name in public documents and a court hearing. Steele suggested that Cosby's lawyers were publicizing them in an attempt to intimidate the women.

McMonagle said many of the women had already gone public with their allegations.

"These are witnesses in a trial. They are not children," he argued.

O'Neill ultimately ruled Cosby's lawyers could identify 11 of the women by name since they'd already told their stories publicly. He said two of the women have remained out of the spotlight and shouldn't be identified in court.

Later, Steele blew up at the defense over the positioning of a projection screen, saying Cosby's lawyers had it placed so the women's names would be seen by dozens of reporters in the courtroom gallery. He again accused the defense of witness intimidation.

McMonagle said courtroom staff positioned the screen, but he agreed to remove accusers' names from a planned presentation.

O'Neill said he'd be forced to call in sheriff's deputies if the lawyers couldn't conduct themselves properly.

The case began a decade ago when Temple University employee Andrea Constand filed a police complaint against Cosby, her friend and mentor, over an encounter at his home. A prosecutor at the time declined to file charges.

But authorities reopened the case last year after scores of women raised similar accusations and after Cosby's damaging deposition testimony from Constand's lawsuit became public. The trial judge last week said the deposition was fair game at trial, arming prosecutors with Cosby's testimony about his affairs with young women, his use of quaaludes as a seduction tool and his version of the sexual encounter with Constand the night in question.

Cosby's lawyers had hoped to question the women in person, but O'Neill rejected the idea.

Some of the women had ongoing friendships or romantic relationships with Cosby — known as America's Dad for his top-rated family sitcom, "The Cosby Show," which ran from 1984 to 1992 — while others knew him for only a few days after meeting him on a plane or at a casino. Some, like Constand, took pills knowingly — she thought it was an herbal drug; he later said it was Benadryl — while others believe he slipped something stronger in their drinks.

McMonagle has petitioned to ask each accuser as many as 80 questions. The defense has also questioned the women's motivation, noting many are clients of celebrity lawyer Gloria Allred, who has suggested Cosby should put up a $100 million settlement fund for potential sexual assault and defamation claims.

Allred told The Associated Press last week that her clients have a duty to testify if the court wants to hear from them. She called the defense's dismissal of their accounts "out of context or just plain wrong."

O'Neill must walk a fine line in weighing their testimony, given a 2015 state Supreme Court ruling that threw out a Roman Catholic Church official's child-endangerment conviction because the Philadelphia trial judge let too many priest-abuse victims testify about the alleged church cover-up.

Cosby greeted security officers with a joke before Tuesday's hearing, quipping, "Don't tase me, bro," as they wanded him on his way into court.

The AP doesn't typically identify people who say they are victims of sexual assault unless they have come forward publicly, as Constand has done.