Stuck and trembling in the mud, the exhausted elephant was gently lifted by a digger—each tug a step toward hope.

It was all’s well that ends well for this young elephant after it fell into a mud pit in Kenya.

After wallowing in the dank ditch for up to 12 hours, these images and video capture the dramatic moment a digger saved the large mammal from a trunkful of trouble in a heroic rescue mission.

The digger gets to work to save the stricken elephant after he got stuck in the well in Chyulu Hills National Park, southern Kenya

The digger gets to work to save the stricken elephant after he got stuck in the well in Chyulu Hills National Park, southern Kenya

The young mammal was stuck wallowing in the dank ditch for up to 12 hours before he was able to make its way out of the muddy water

The young mammal was stuck wallowing in the dank ditch for up to 12 hours before he was able to make its way out of the muddy water

This is the moment the elephant made its break for safety, after the digger was able to create a gentle slope out of the heavy clay

This is the moment the elephant made its break for safety, after the digger was able to create a gentle slope out of the heavy clay

Unable to help the large mammal climb the steep clay sides, wildlife conservationists enlisted the aid of a heroic construction company, who used their digger to plough the elephant to safety.

Local farmers were shocked to find the male elephant desperately trying to escape from a deep mud pit he had been trying to drink from

Local farmers were shocked to find the male elephant desperately trying to escape from a deep mud pit he had been trying to drink from

The rescue took place near the town of Makindu. Conservation scientist and wildlife photographer Jeremy Goss, 30, captured what happened

The rescue took place near the town of Makindu. Conservation scientist and wildlife photographer Jeremy Goss, 30, captured what happened

The elephant was thought to be searching for water in an area of southern Kenya which is experiencing an unusually intense dry period

The elephant was thought to be searching for water in an area of southern Kenya which is experiencing an unusually intense dry period

The young elephant appears to make a plea for help with his trunk

The young elephant appears to make a plea for help with his trunk (left), through which he was at least able to breath while he was stuck (right)

Wildlife conservationists and park rangers from The Kenya Wildlife Service and Big Life Foundation were quick to the scene to help excavate the animal from its muddy prison.

Using his trunk he was at least able to breath while he was stuck

After it became clear there was no way for wildlife rangers to break the slippery bank, it was left to a digger from Chinese company China Road and Bridge Corporation, working on a nearby railway, to cultivate a gap in the bank allowing the mammal to walk to freedom.

 Wildlife conservationists and park rangers from The Kenya Wildlife Service and Big Life Foundation were quick to the scene

Wildlife conservationists and park rangers from The Kenya Wildlife Service and Big Life Foundation were quick to the scene

The elephant enjoys his new found freedom. He was exhausted from the ordeal and was nearly too tired to move from the ditch

The elephant enjoys his new found freedom. He was exhausted from the ordeal and was nearly too tired to move from the ditch

The elephant was eventually encouraged to make its dash out onto the open plains after being nudged by the digger

The elephant was eventually encouraged to make its dash out onto the open plains after being nudged by the digger

‘The digger managed to get the elephant out by digging one side out of the well, the operator having to make precision movements to avoid hitting the elephant in the small well.

‘Once it emerged, it seemed very tired but otherwise seemingly unharmed.’

Following the rescue, rangers were called upon to escort the elephant from the farmland back into Chyulu Hills National Park, home to the highest mountain range in eastern Kenya.

Using land cruisers and a helicopter, rangers tried to push the elephant in the direction of the 100 kilometre long Chyulu Hills National Park

Using land cruisers and a helicopter, rangers tried to push the elephant in the direction of the 100 kilometre long Chyulu Hills National Park

The move was needed to keep the male from heading back towards other farms and settlements where he may have got into more trouble

The move was needed to keep the male from heading back towards other farms and settlements where he may have got into more trouble