An Arizona grandfather was arrested Monday after he was accused of leaving his 5-year-old granddaughter alone in the desert with a loaded .45-caliber handgun with the instruction to "shoot any bad guys," authorities said.

Paul Armand Rater, 53, was booked into the Fourth Avenue Jail in downtown Phoenix on suspicion of two counts of felony child abuse and one count of felony child endangerment stemming from Sunday evening's incident, according to KTAR News.

The Maricopa County Sheriff's Office said Rater and the girl left his home in Buckeye, about 30 miles west of Phoenix, in a pickup truck early on Sunday afternoon. She was reported missing four hours later.

A helicopter was dispatched to find the girl, who was believed to be somewhere in Rainbow Valley, about 12 miles from Buckeye. She was eventually located in the desert by her mother and an off-duty firefighter where she was found in possession of the loaded and cocked pistol.

"She was given the gun and told to shoot any bad guys," Maricopa County Sheriff Joe Arpaio told Reuters. "I don't know how a 5-year-old can tell a good guy from a bad guy, but that's what she said she was told."

Deputies later found Rater at a store where he admitted to leaving the girl alone in the desert while he went to get a few drinks and a cheeseburger, reported The Guardian. He explained to deputies that the vehicle had broken down and he left the girl under a tree in the desert because she was complaining she could not walk anymore.

The child was returned to her mother and state child welfare authorities were alerted, the sheriff's office said.