A judge hearing a criminal jury trial in Dukes County Superior Court took the unusual step Friday of halting proceedings and admonishing the prosecutor for misconduct, but declined to dismiss the case.

The Hon. Richard Chin, an associate justice of the superior court, said assistant district attorney Laura Marshard had improperly hindered the defense. The judge also said certain actions by Ms. Marshard may have been prejudicial to the two defendants in the case, who are African American.

“I’ve been a judge for 25 years and I’ve never had a circumstance like this,” Judge Chin said, speaking from the bench in the main courtroom in the Edgartown courthouse Friday morning.

The case involves an alleged assault that took place during a brawl in an Oak Bluffs bar in March of 2013. The defendants in the case are Patrece Petersen of Edgartown and Daryl Baptiste, now a resident of Pennsylvania. Both men are facing multiple assault charges and Mr. Petersen is also charged with attempted murder. They were indicted by a grand jury in April 2013.

A trial began Tuesday before a jury of 10 women and four men.

Assistant district attorney Laura Marshard was admonished for hindering the defense in a criminal jury trial underway this week. — Mark Lovewell

On Thursday the jury was dismissed from the room as attorneys representing the defendants said they had been precluded from presenting a defense after a key witness of theirs said he was concerned about testifying because he might be prosecuted.

John Amabile, who represents Mr. Baptiste, and Robert Moriarty, who represents Mr. Petersen, both said they felt what had happened was a strategic move by the commonwealth. Ms. Marshard, who works for the Cape and Islands district attorney’s office and is prosecuting the case for the state, later denied the claims and said witnesses had never been harassed or threatened with prosecution.

Judge Chin suspended the trial for the remainder of the day Thursday so the attorneys could file motions. Without the jury present on Friday morning, Judge Chin heard a motion to dismiss the case from Mr. Moriarty and Mr. Amabile.

Mr. Moriarty said there had been a “deliberate and purposeful attempt to keep these defendants from rendering a defense.”

Mr. Amabile said that the commonwealth was long aware what the witness would say in court, and “the fact that they sort of turned a blind eye to it does not relieve them of misconduct in this case.”

He said the testimony in question “completely exculpates my client and Mr. Petersen.”

Ms. Marshard defended her actions. “The commonwealth has always acted as an officer of the court,” she said, which included alerting the court to possible fifth amendment concerns, she said.

Though Mr. Chin did not allow the case to be dismissed, he said he did find a pattern of misconduct by the prosecution.

“I find that there was prosecutorial misconduct, I think from the beginning,” Judge Chin said. He cited late disclosure of a witness statement, strategic use of fifth amendment rights that hindered the defense and the mention of a mugshot of one of the defendants.

Judge Chin said he found that to be “highly prejudicial to two young African American men.” Both Mr. Petersen and Mr. Baptiste are African American; the alleged victims in the case are white.

Judge Chin had earlier noted that there were racial undertones to the case. “That’s what complicates this case, is black on white crime, allegedly, and I’m conscious of that,” he said.

The judge also took responsibility for his own role. “I think my job in this case was to keep that type of prejudice out of this case,” he said.

Judge Chin and counsel discussed various remedies to the case, including the unusual step of allowing judicial immunity for the witness. In the end, the judge resolved the issue by allowing a written statement by the witness to be read into the record. The jury was told the witness was unavailable.

Testimony concluded in the case early Friday afternoon, and closing arguments are expected Monday morning.