An Indian forest ranger wrapped a 90-pound python around his shoulders in order to take a selfie with the mammoth reptile. Moments later, his staff was seen rushing to his side in order to keep the snake from crushing his neck. The ranger’s near-death experience was caught on video, which quickly went viral.

The ranger in question was Sanjay Dutta, who was called to the village of Sahebbari, West Bengal, on Sunday to catch the Indian rock python after it swallowed a goat alive near a local school.

While Dutta managed to capture the 30-foot-long snake, he proceeded to wrap it around his shoulder before posing for a selfie, instead of putting it safely inside a bag, ready to be carried away from civilization. With one hand he held the head of the creature while with the other, he firmly held its tail.

Moments later, as one of the villagers prepared to click a selfie with Dutta, the python was seen constricting the ranger’s airway, almost choking him. The beast managed to wrap one coil almost entirely around his neck.

The locals watched horrified as the snake strangled Dutta. One of his assistants rushed forward and pulled on the snake’s tail, forcing the reptile to free Dutta. Thanks to the timely help from the villagers standing nearby and his staff, Dutta managed to walk away from the stunt unscathed.

At one point, Dutta’s hold on the snake slipped, making the crowd run for cover. As Dutta and his staff carried the snake away, he is heard saying, “Leave it, nothing will happen.”

Although Dutta looked visibly panicked in the video, he later said of the incident that he “was not scared for even a moment. Because had I panicked, it could have been fatal,” the New York Post reported.

The snake was taken away and released into a nearby forest.

Dutta was severely criticized for pulling such a dangerous stunt in front of civilians, saying it set a bad example.

“It is not justified. If forest officers do such tricks, who will stop the common people from following them?” Ravi Kant Sinha, the state’s chief wildlife warden, said. State Forest Minister Binay Krishna Barman also condemned Dutta’s actions on similar lines. “This officer is very enthusiastic. Care should be taken during rescues or he will invite danger,” he said, Newsweek reported. 

Indian rock pythons are non-venomous. Their preferred method of preying is crushing their food and swallowing them whole.

The incident comes days after an Indonesian woman, Wa Tiba, 54, was devoured by a 23-foot-long python. Locals found a bloated python after news of Tiba disappearing while gardening was circulated in their village of Persiapan Lawela.

"Residents were suspicious the snake swallowed the victim, so they killed it, then carried it out of the garden," local police chief Hamka said. "The snake's belly was cut open, and the body of the victim was found inside.”

Python An Indian forest ranger wrapped a 90-pound python around his shoulders in order to take a selfie with the mammoth reptile. In this photo, Edward Mercer, a Florida Fish and Wildlife Conservation Commission non-native Wildlife Technician, holds a Burmese Python during a press conference in the Florida Everglades about the non-native species in Miami, Florida, Jan. 29, 2015. Photo: Getty Images/ Joe Raedle