Poppy the Jack Russell got wedged down a drainpipe while out with her owner in Tadcaster on Saturday afternoon.
Crews from North Yorkshire Fire and Rescue Service were called to the scene near Wetherby Road after the pooch found herself trapped.
A spokesman for the service said fire fighters had to "dig their way to the dog" before handing her back to her "grateful" owner.
Station manager Bob Hoskins said Poppy was now "safely back with her owner".
It was a particularly busy day for fire fighters in the region, with crews from ten different fire stations attending a fire at Ilkley Moor on Saturday morning. The fire - the second in under a month - was brought under control within a few hours.
West Yorkshire Police confirmed a 48-year-old woman was arrested in connection with the blaze.