A deputy sheriff and prisoner were injured during a shootout at a Boston hospital on Wednesday afternoon, CBS reported.

The Boston police confirmed the prisoner is in custody.

The shootout happened after two officers brought a prisoner in to the Massachusetts Eye and Ear Infirmary for treatment. Once the handcuffs were off of him, the prisoner jumped at one of the officers who was shot in the leg. The other officer then shot the prisoner.

A witness, who asked to remain anonymous to reporters, heard the incident happen while she was in the waiting room.

"I heard them trying to control somebody first and then I heard shouting and then I heard the gunshots," she said. "It was at least four to six."

It's unknown if the prisoner shot the first officer or if the handgun went off during the scuffle. Police said that although he is in serious condition, the officer is expected to recover. The prisoner is in critical condition at Massachusetts General Hospital due to a more serious wound.

According to the Boston Police Department's Twitter account, which was updated within an hour of the shooting, the streets in and around the Infirmary area have been reopened.

"The situation in the ED is completely secure. No patients or staff were hurt. It is safe for patients and visitors to come and go as needed," The Massachusetts Ear and Eye Infirmary Twitter account said.

Jennifer Street, Vice President of Communications and Planning at the Massachusetts Ear and Eye Infirmary, told reporters "Massachusetts Eye and Ear is grateful to our emergency department employees and certainly to the police department and the state troopers who brought this situation under control very quickly."

The names of the officers or the prisoner have not yet been released.