Fresno County sheriff's officials identified the suspect as 39-year-old Omar Rosales of Sanger

FRESNO, Calif. (KFSN) -- An alert Fresno County homeowner, armed with a gun, stopped a thief from burglarizing his home, according to sheriff's officials.Deputies say the homeowner woke up to the sound of his door being rattle just after 7 a.m. off Belmont and Bethel.He got up and looked outside, only to come face-to-face with the suspect. Detectives say he grabbed a gun, called 911, and detained 39-year-old Omar Rosales until deputies arrived."I will never tell anyone not to protect their own property. It is a dangerous situation," said Sgt. David Pugliese. "You will never know what you will get when it's someone you are not expecting. You never know if they are carrying a gun or what their intentions are going to be. It is never a safe situation to confront somebody."Deputies say the man has a gate in front of his home, but the suspect opened it and drove in.Orchards surround the home, and deputies believe that could be why it was targeted.The suspect never made it inside the house and is now being booked into jail on charges of attempted burglary.