A Bexar County deputy was hospitalized Tuesday afternoon after he accidentally shot himself in the leg.

Officials at the sheriff's office said the deputy was retrieving his gun after he got off duty, and the gun discharged when he re-holstered it.

Officials said the deputy was hit just above the knee. He was taken to the hospital and was expected to recover.

The sheriff's office said the deputy has been with the department for five years. An investigation into the shooting is underway.