CYPRESS, Texas- A suspect accidentally shot himself when his firearm discharged upon K-9 contact Saturday morning in northwest Harris County, authorities say.

According to the Harris County Sheriff's Office, two men attempted to breaking into a Fort Bend County Sheriff's Office vehicle around 4 a.m. in the 15200 block of Green Whisper.

HCSO says the suspects wore masks and were armed.

The suspects fled the scene whe a resident went outside the home to confront them.

A K-9 unit found one of the suspects in a backyard. HCSO says when they let the dog loose, the suspect's firearm discharged upon contact, resulting in a gunshot wound to the head. The suspect was transported to the hospital where he was pronounced dead.

The other suspect was located and taken into custody without incident.