By Donna Owens

BALTIMORE (Reuters) - 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.

Prosecutors argue that Goodson caused Gray's death by giving him a "rough ride." Goodson's lawyers say Gray caused his own injuries.

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 notes to prosecutors about Allan's comments.

Taylor answered 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."

Schatzow responded that Bledsoe had made allegations about Taylor's own integrity.

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.

Allan, an assistant medical examiner, has stood by her judgment that Gray's death was a homicide.

Another defense witness, Donta Allen, who was transported with Gray in the van but separated from him by a metal partition, initially said on Thursday he remembered nothing about the ride.

On further questioning by prosecutors however, he said that when the van stopped at a Baltimore police station, he heard someone say they gave Gray "a run for his money" after he was found unconscious.

Police have said Allen told investigators Gray was thrashing around in the van. Allen recanted that statement in court, saying he never hear loud banging, adding he was high on heroin and Xanax when he gave his initial police report.

Goodson is the third officer tried in Gray's death. One of the earlier trials ended in a hung jury, while the other ended with an acquittal.

(Writing by Ian Simpson in Washington; Editing by Curtis Skinner and Peter Cooney)