A suspect who allegedly shot a sheriff's deputy in the hand during a struggle for the deputy's gun in a Texas hospital this week was charged Thursday with aggravated assault on a peace officer, according to police.

Thaddeus Lewis, 35, is accused of grabbing a Harris County sheriff's deputy’s weapon and firing it Wednesday while he was being escorted to the restroom on the fifth floor of Ben Taub Hospital in Houston. Lewis, a jail inmate, was brought there for a doctor’s appointment. 

Four members of the hospital staff came to the deputy's aid and helped apprehend Lewis during the tussle. 

HOUSTON HOSPITAL HEROISM: STAFF MEMBERS HELP APPREHEND INMATE AFTER DEPUTY IS SHOT IN STRUGGLE OVER HIS GUN

"It could very well have escalated," a spokesman for the Houston Police Department said outside the hospital Wednesday. "That's why I want to commend the hospital staff for assisting in getting this inmate in custody."

The deputy, a 36-year veteran, was treated at the hospital. He suffered a severe gunshot wound to his left hand, with the bullet leaving both entry and exit wounds, a police spokesman said. He was in stable condition, police said in a release. 

CLICK HERE TO GET THE FOX NEWS APP

Lewis was not injured in the struggle, according to FOX 26 of Houston.  

Lewis was returned to the Harris County Joint Processing Center, police said. 

Ben Taub Hospital is located inside Texas Medical Center, which bills itself as the "largest medical city in the world."

Fox News' Paul Best contributed to this report.