The baby elephant got stuck in the mud after trying to cool off.
It happened at Bandipur tiger reserve in Karnataka, southern India, on Saturday.
The footage shows the unlucky elephant writhing on his side, trying to be free.
The yellow JBC excavator driver nudged the elephant to help it up.
Adorable footage shows the moment a JCB gives a trapped baby elephant a helpful nudge after getting stuck in the mud.
The poor creature was trying to take a mud bath to cool off in the summer heat in southern India on Saturday.
However, the newborn was stuck in a pile of sticky garbage in the Bandipur tiger reserve in Karnataka.
Footage shows the unlucky elephant writhing on its side in a large puddle of mud, trying to free itself.
But it seemed to be slowly dying out, so the digger was brought to the rescue before any predators could attack the vulnerable animal.
Onlookers alerted the forestry officials looking after the area, and the touching video shows the elephant being helped to his feet.
The driver used the excavator to push the elephant upright from its lying position gently.
Since then, the elephant has been able to stand up on its own in the mud after escaping from the muck.
The excavator reversed to allow the elephant to stand up and find its way out of the mud.
Forest officials watched it for several hours and left it after it appeared healthy after its challenge on May 15.