A video of a mongoose escaping a snake attack in a split second has gone viral on social media, leaving people in awe of the animal for its quick-thinking.

The video, shared by Indian Forest Services officer Susanta Nanda on Twitter on Monday, showed the mongoose escaping an attack by a cobra in the nick of time. In the video, the mongoose can be seen jumping into the air as the reptile strikes.

"The art of living. That split second to evade the Cobra and death, matters the most for the mongoose when they square up to each other. The use of the tail as a rudder to navigate and balance when in air is spectacular,” Nanda wrote. The date and location of the incident were not known.

The video has since gone viral on Twitter.

The incident comes days after the officer shared a video of a python attacking a deer as it drank water with its herd. The video, shot in the western Indian state of Maharashtra, showed the reptile leaping out of the pool and attacking it, sending the animal flying in the air. The python then coils around the deer and strangulates it before swallowing it.

“One of the clips from E surveillance Video of Central Chanda Division from Maharashtra. When pythons kill prey, they use a kind of ambush technique by jumping & striking the prey, grabbing it with their teeth in around 50 milliseconds only. [Humans take 200ms to blink an eye],” Nanda wrote.

King Cobra
A king cobra is displayed to the public at Noah's Ark Zoo Farm in Bristol, England, Aug. 2, 2016. Getty Images