Firefighters were helped by more than 30 villagers as they worked for eight hours to free a dog trapped in a pipe in Buckinghamshire.
Crews were offered drinks, helpings of turkey casserole and the use of diggers as they tried to rescue the male border collie in Hanslope on Sunday.
The dog became trapped about 8ft (2.5m) underground after running 82ft (25m) along the pipe via a drainage culvert.
It was dug out at 2045 GMT, the fire service said.
Station manager Tony Bennett, the incident commander, said: "It was one of those good old-fashioned situations where everyone pulls together to sort it out, and the outcome was fantastic."
The urban search and rescue team from Aylesbury used cameras and listening devices to pinpoint the dog in the plastic pipe, which had a diameter of 1ft 3in (40cm), the fire service said.
Mr Bennett added: "About 30 local people and members of the farming community gathered to watch and help, and they were able to call on the services of a mini-digger and a large mechanical digger.
"The pipe was flexible and corrugated, and when we finally broke through to the section near the dog and started to saw through it, we must have dislodged it and distorted it enough to allow the dog to free itself.
"It was then able to go back along the pipe and come out the way it had got in, into the arms of a firefighter."
Mr Bennett thanked local people for their help and support, and for providing hot food and drinks throughout the day, and praised the crews.
"There was never any thought of giving up, even when we started to fear that it might all be too late to save the dog," he added.