A precocious puppy in Detroit that found itself stuck in a drain pipe for more than 12 hours was liberated Thursday thanks to the efforts of hard-working rescue crews, United Press International reports.

The puppy was freed after rescue crews worked all day to dig a seven foot deep trench so they could reach the dog, according to the Detroit News.

Kevin Hatman, a spokesman for the Michigan Humane Society, told the paper workers got a call 8 a.m. that morning from a homeowner who said that the puppy crawled into the pipe the night before and got stuck.

"It was crying, and I was crying all night, I felt so bad," the dog's owner, who asked not to be identified, told WXYZ News.

Humane Society workers called local plumbing and excavation companies to the scene to help form a plan to reach the puppy, which workers estimated had crawled through 15 feet of pipe before getting trapped near the foundation of the house.

"He couldn't go any farther," Aaron Baughey, owner of the excavation company that helped save the pooch, told the Detroit News. "We had to get below the floor, then tunneled back by hand under the floor along the pipe until we could get him out."

Hatman said the pup was in relatively good condition after being pulled from the pipe, though it was certainly cold and hungry. Humane Society workers put it back with its mother so it could be nursed, according to WXYZ.

WATCH: