Updated

A California German Shepherd found himself in a strange predicament Monday when he stuck his head in an 18-inch hole, then couldn't get it out.

The dog's owner wasn't home but a neighbor heard the 8-month-old dog crying and came outside to find his body on one side of the wall and his head popping out of the other.

The woman called Riverside County Animal Services, who responded immediately.

"My initial reaction was, 'Wow, how'd he get in there?'” Riverside County Animal Services Sgt. James Huffman said in a statement from the agency. "And why is there a hole that big in the wall?"

The officers managed to nudge the dog free after roughly 30 minutes.

"Somehow he got in through there, so we knew we could get him out," Huffman said.

Huffman said he released the dog to the neighbor but planned to return Tuesday to suggest the property put chicken wire on the hole.