Correction: An earlier version of this story incorrectly described the prisoner in the van as a 38-year-old man accused of violating a protective order. This version has been corrected. The Post also has updated this story to add comments from the prisoner, 22-year-old Donta Allen, and to reflect charges filed against the police officers.

A prisoner sharing a police transport van with Freddie Gray told investigators that he could hear Gray “banging against the walls” of the vehicle and believed that he “was intentionally trying to injure himself,” according to a police document obtained by The Washington Post.

The prisoner was separated from Gray by a metal partition and could not see him. His statement is contained in an application for a search warrant, which is sealed by the court. The Post was given the document under the condition that the prisoner not be named because the person who provided it feared for the inmate’s safety. But the prisoner, Donta Allen, 22, later spoke to the media, including The Post, and allowed himself to be identified.

In a phone interview, Allen said he had been in the van with Gray and told police he heard “light banging.” He said the police report incorrectly characterized his statements to authorities and that he “never ever said to police that [Gray] was hurting himself.”

Allen, who is on probation for an armed robbery conviction, declined to comment further.

The document, written by a Baltimore police investigator, offers the first glimpse of what might have happened inside the van. It is not clear whether any additional evidence backs up the prisoner’s version, which is just one piece of a much larger probe.

The death of 25-year-old Baltimore resident Freddie Gray is sparking demonstrations and riots in the city. Take a look at Gray’s past and the video that shows his arrest just days before his death. (The Washington Post)

Prosecutors on May 1 announced they had charged six officers in connection with Gray’s death. One officer faces a second-degree murder charge, three others are charged with manslaughter. The remaining two face charges including second-degree assault and misconduct in office.

Gray was found unconscious in the wagon when it arrived at a police station on April 12. The 25-year-old had suffered a spinal injury and died a week later, touching off waves of protests across Baltimore, capped by a riot Monday in which hundreds of angry residents torched buildings, looted stores and pelted police officers with rocks.

Police have said they do not know whether Gray was injured during the arrest or during his 30-minute ride in the van. Local police and the U.S. Justice Department both have launched investigations of Gray’s death.

Jason Downs, one of the attorneys for the Gray family, said the family had not been told of the prisoner’s comments to investigators.

“We disagree with any implication that Freddie Gray severed his own spinal cord,” Downs said. “We question the accuracy of the police reports we’ve seen thus far, including the police report that says Mr. Gray was arrested without force or incident.”

Events leading to Gray’s arrest and hospitalization

Capt. Eric Kowalczyk, chief spokesman for the Baltimore Police Department, declined to comment on the affidavit, citing the ongoing investigation. The person who provided the document did so on condition of anonymity.

The affidavit is part of a search warrant seeking the seizure of the uniform worn by one of the officers involved in Gray’s arrest or transport. It does not say how many officers were in the van, whether any reported that they heard banging or whether they would have been able to help Gray if he was seeking to injure himself. Police have mentioned only two prisoners in the van.

Baltimore Police Commissioner Anthony W. Batts has admitted flaws in the way officers handled Gray after they chased him through a West Baltimore housing project and arrested him. They said they later found a switchblade clipped to the inside of his pants. Batts has said officers repeatedly ignored Gray’s pleas for medical help and failed to secure him with a safety belt or harness in the back of the transport van.

Video shot by several bystanders has fueled the rage in West Baltimore. It shows two officers on top of Gray, putting their knees in his back, then dragging his seemingly limp body to the van as he cries out.

Batts has said Gray stood on one leg and climbed into the van on his own.

The van driver stopped three times while transporting Gray to a booking center, the first to put him in leg irons. Batts said the officer driving the van described Gray as “irate.” The search warrant application says Gray “continued to be combative in the police wagon.”

The driver made a second stop, five minutes later, and asked an officer to help check on Gray. At that stop, police have said the van driver found Gray on the floor of the van and put him back on the seat, still without restraints. Police said Gray asked for medical help at that point.

The third stop was to put the other prisoner into the van. The van was then driven six blocks to the Western District station. Gray was taken from there to a hospital, where he died April 19.

Batts has said officers violated policy by failing to properly restrain Gray. But the president of the Baltimore police union noted that the policy mandating seat belts took effect April 3 and was e-mailed to officers as part of a package of five policy changes on April 9, three days before Gray was arrested.

Gene Ryan, the police union president, said many officers aren’t reading the new policies — updated to meet new national standards — because they think they’re the same rules they already know, with cosmetic changes. The updates are supposed to be read out during pre-shift meetings.

The previous policy was written in 1997, when the department used smaller, boxier wagons that officers called “ice cream trucks.” They originally had a metal bar that prisoners had to hold during the ride. Seat belts were added later, but the policy made their use discretionary.

Ryan said that until all facts become clear, he “urged everyone not to rush to judgment. The facts as presented will speak for themselves. I just wish everyone would take a step back and a deep breath, and let the investigation unfold.”

The search warrant application says that detectives at the time did not know where the officer’s uniform was located and that they wanted his department-issued long-sleeve shirts, pants and black boots or shoes. The document says investigators think that Gray’s DNA might be found on the officer’s clothes.

Keith L. Alexander contributed to this report.