A Maryland medical examiner twice told investigators that the death of black detainee Freddie Gray from a broken neck in a police van was an accident, a Baltimore detective testified on Thursday.

Taking the stand for the defense in the van driver's murder trial, Police Detective Dawnyell Taylor said Dr Carol Allan had contradicted her official report that Gray's death in April 2015 was a homicide.

"She said that it was a freakish accident, and that no human hands had caused his injury," she said as the defense for Officer Caesar Goodson Jr began presenting its case in Baltimore City Circuit Court.

Goodson, 46, is accused of second-degree depraved heart murder, manslaughter and other charges. Gray's death triggered protests and rioting in Baltimore and fueled a nationwide debate on police treatment of minorities.

In a sometimes-testy exchange, prosecutor Michael Schatzow accused Taylor, whose investigation led to charges against Goodson and five other officers, of not sending progress reports to prosecutors about Allan's comments.

Taylor answered that she was initially not the lead detective but had noted everything later when it was typed up. Referring to another prosecutor in the Gray case, Janice Bledsoe, she said: "I had a problem with her integrity."

"Didn't she have problems with your integrity?" Schatzow responded. Judge Barry Williams, who is hearing the case in a bench trial, then called up both sides for a conference.

Throughout the high-profile case, Allan, an assistant medical examiner, has stood by her judgment that Gray's death was a homicide. Her ruling is a major part of the charges against Goodson and the other officers.

Taylor's testimony came after Williams rejected a defense motion for charges against Goodson to be dropped. Goodson is the third officer to be tried in Gray's death, with the two earlier trials ending in a hung jury and an acquittal.

Schatzow has argued that Goodson caused Gray's death by giving him a "rough ride." But the officer's lawyers say Gray caused his own fatal injuries.

Gray, 25, was arrested for fleeing officers unprovoked. He was bundled into Goodson's van shackled and was not seat-belted, a violation of department protocol.

(Writing by Ian Simpson in Washington; Editing by Bernadette Baum)