Sometimes the predator becomes the prey.

A Longview resident thwarted a home invasion, and mugshots of the alleged burglar show he apparently took a beating in the process.

Kevin Mitchell Gonzales, 28, was arrested after police say he engaged in a scuffle with a homeowner after trying to enter the dwelling through the garage.

During the fight, Gonzales pulled out a pistol and fired a shot. The homeowner then took the pistol from the suspect and managed to restrain him until police arrived.

The homeowner was not injured. Police also found 18 Lorazepam (Ativan) pills in the suspect’s pants pocket.

He faces charges for criminal trespass with a deadly weapon, and possession of a controlled substance.