HAYWARD (CBS SF) — A dramatic standoff between police and an armed suspect who had fired shots from inside his Hayward home ended peacefully with the help of drones and a robot that was able to determine the gunman had fallen asleep in his bed, police said Monday.

The incident happened last week when a frantic mother called 911 sometime after midnight to say her son was in his room with a gun and wanted to kill himself, according to Hayward police.

READ MORE: UPDATE: Evacuation Orders Downgraded to Warnings as Crews Mop Up Estrada Fire Near Watsonville

“Our Dispatch center gets over 100,000 calls every year,” said a statement from Hayward police. “There are times the calls cause the hair on the back of your neck to stand up. This was one of those calls.”

Family members could hear him manipulating the gun and the 911 operator urged everyone to quickly evacuate the house. Responding officers used a P.A. system to try and communicate with the unidentified suspect before hearing four gunshots in rapid succession, police said. Subsequent attempts to communicate with the suspect with the P.A. system were unsuccessful.

“It was a difficult situation. We wanted to help him immediately but sending officers into a home with a potentially armed man could be very dangerous,” said the police statement.

READ MORE: Pleasant Hill Police Ask Public for Help Finding Stabbing Suspect

The Alameda County Sheriff’s Office was contacted and asked if their Unmanned Aerial Vehicle Team could help resolve the standoff. The sheriff’s office quickly responded with drones to approach the home and see through the windows, but officers were not able to spot the man. Other “pocket drones” were deployed by officers inside the home along with a robot to allow controllers to see inside all the rooms, police said.

Eventually, the drones were able to confirm the man was sleeping in his bed. He was not injured and police were able at last to communicate with him and get him to come outside.

“Just the peaceful resolution we were looking for!” said the police statement.

There was no word on the man’s medical or mental health issues or whether he was being charged with any crime.

MORE NEWS: Alameda Police Seek Person of Interest in Friday Night Shooting