Officer Caesar Goodson leaves the courthouse at the end of Day 4 of his trial on June 14 in Baltimore. Goodson is charged in the death of Freddie Gray. (Bryan Woolston/Reuters)

Prosecutors and a city police detective ripped into each other in court Thursday, with the chief deputy state’s attorney accusing the detective of “sabotaging” their case against the officers charged in the arrest and death of Freddie Gray.

Tensions boiled over when prosecutor Michael Schatzow accused Detective Dawnyell Taylor, the lead police investigator in Gray’s death, of fabricating notes to suggest that the state’s medical examiner believed the manner of death was an accident rather than a homicide.

Taylor fired back that her notes were accurate and that Deputy State’s Attorney Janice Bledsoe, one of the prosecutors handling the case, lacked integrity.

The heated exchange came in a chaotic sixth day of the trial against Officer Caesar Goodson Jr., who drove the police van in which Gray suffered a fatal spine injury in April 2015. The day’s testimony also included an account from the sole prisoner who rode with Gray during a portion of the trip to jail.

Prosecutors claim Goodson, 46, gave Gray a “rough ride,” driving recklessly as Gray, wearing shackles but no seat belt, bounced around in the vehicle’s prisoner compartment.

Events leading to Freddie Gray’s death, explained in augmented reality

Goodson’s attorneys contend there is no evidence of a rough ride and that Gray’s death was an accident. They say the reason police did not buckle Gray was that he was combative and it would have been unsafe for officers to enter the narrow compartment of the van with the arrestee.

Assistant medical examiner Carol Allan testified last week that she never considered the manner of death accidental, ruling instead that it was a homicide. But Taylor's notes suggest that Allan told investigators she initially believed Gray’s death was a “freakish accident” and that “no human hands caused this injury.”

During a fiery cross-examination, Schatzow claimed that police pressured Allan in those meetings to classify Gray’s death an accident. Schatzow accused Taylor of doctoring her notes after fighting with Bledsoe.

“When you started having problems with Ms. Bledsoe, you went back and created these notes,” Schatzow said.

“All notes aren’t going to be written at that time," Taylor responded. “My problems with Ms. Bledsoe were about her integrity.”

Taylor testified that she later tried to give her notes to Bledsoe but Bledsoe refused to accept them.

“She pushed them back across the table and stormed out of the room in a tantrum,” Taylor said.

Goodson faces the lone murder charge in connection with Gray’s death, as well as counts of manslaughter, reckless endangerment, assault and misconduct in office. He is among six officers who were charged in the Gray case; last month, one of those officers was acquitted.

The court also heard testimony from Donta Allen, the arrestee who rode on the other side of a thin metal partition from Gray in the van during the final leg of the ride through West Baltimore.

Allen told police last April that Gray banged his head “loudly” several times on the partition, but in testimony Thursday he said that he did not know what Gray was doing before the van reached Baltimore’s Western District police station.

“I can’t tell you if he was banging his head if I can't see on the other side” of the partition, Allen told the court.

Allen’s testimony has been a source of contention. After giving his initial statement to police about Gray banging his head, Allen told The Washington Post and other media outlets that his statement was mischaracterized and that he never said Gray was harming himself.

Under direct examination by Goodson’s attorney, Allen was uncooperative, saying repeatedly, “I don't recall anything from that day.”

Attorneys played the full video of Allen’s statement to police, during which Allen told two detectives that he heard Gray banging his head “pretty hard” four or five times. He also told the detectives that the ride to jail was “smooth.”

“You must have gave him a run for his money because he’s unconscious,” Allen testified he heard an officer say of Gray being unresponsive.

The defense’s first day of witnesses began with Williams rejecting a request by Goodson’s attorneys to acquit the officer on all charges, saying it would be “inappropriate” to issue a judgment at that point in the case. But Williams seemed skeptical about whether the state’s “rough ride” theory would hold up, saying the decision to proceed with the murder charge was a “close call.”

Police arrested Gray on April 12, 2015, after he made eye contact with officers and ran. He was loaded into a police van to be taken to jail.

Goodson is the third officer to go to trial, following Officers William Porter and Edward M. Nero. Porter stood trial in the same court in December, but a jury failed to reach a verdict. He is scheduled to be retried in September. Nero was acquitted last month.