A valet injured outside the Brigham and Women's Hospital earlier this month was accidentally shot by a Boston police officer, Suffolk County District Attorney Rachael Rollins announced Tuesday.

Rollins said the valet was shot by an undisclosed officer in a chaotic scene where police officers thought they were interacting with an armed gunman. The man, later identified as 41-year-old Juston Root of Mattapan, then jumped in a car and fled to Brookline. The valet, who has not been identified, sustained serious injuries to his eye.

Rollins said investigators later determined Root was holding a fake, "replica firearm" that was "very realistic looking."

“The investigation revealed that the weapon recovered on scene near Mr. Root in Norfolk County, which he had brandished in Suffolk County, was not a working firearm,” Rollins said in a press conference alongside Boston Police Commissioner William Gross. “The valet was struck by a bullet discharged by a Boston police officer.”

Rollins provided new details to the confusing scene that crossed two Massachusetts counties and ended in Root’s death. She released a video from outside the hospital showing Root appearing to shoot at one of the officers, who fell to the ground as he ran away.

The district attorney’s office is still investigating the shooting, she said, but preliminary details show officers arrived at the scene with the understanding Root had a gun.

“We will not rush to judgment," she said. "In this role we stand here and look to make sure the hard job the police do every day, that they did not engage in any criminal behavior.

Gross said he spoke to the valet Tuesday morning. He said the police department is glad no one else was injured and that the video shows the “officer was definitely in fear of his life.”

The investigation is ongoing both in Norfolk and Suffolk Counties.

Correction: This article has been updated with the correct spelling of Juston Root's first name.