The 18-foot python started wriggling, then twisting and turning around the forest ranger's neck.

Highlights Forest ranger catches 18-ft python, wears it like a collar

Snake goes out of control, tries to choke the man

With help, forest ranger manages to regain control

The forest ranger grabbed the snake by its neck and posed for a selfie.

It may sound like a cool thing to do - a display of bravado to entertain the masses - but a selfie with a snake is always a bad idea, even if you are a trained professional, as a forest ranger in West Bengal learned on Sunday.Called in by villagers to capture a rock python killing and eating a goat, the ranger and his assistants rushed to the village in Jalpaiguri 600 km from Kolkata and collared the 18-foot snake that weighed about 40 kg.The normal procedure in such cases is the snake would be stuffed into a sack and carried away, to be released into the forest later.But such is the power of the selfie and such was a vanity of the forest officer, he grabbed the snake by its neck with his right hand and slung it with great flourish around his neck.And the flashbulbs popped. And selfie-takers went wild and the forest officer preened.But not for long.In fact, within seconds, the snake - probably coming out of the initial shock of being captured - started wriggling, then twisting and turning.With the situation getting distinctly slippery, the forest ranger's bravado starting fading and he started walking away from the crowds and then screams and people running as the snake started to choke the forest ranger, its coils gripping his throat from the back.It slipped out of the hands of who ever was holding its tail and for a few heart stopping seconds, it seemed set to win the battle with the forest ranger.A man in blue, possibly a forest department employee, ran forward to come to the forest ranger's rescue.In the melee, the camera person seemed to have taken fright.But photographers were clicking away and you can see how the coils almost got the forest ranger.A narrow shave, if ever there was one.The ranger is heard telling his assistant in a voice of suppressed panic, "hold the tail, hold the tail" and then "it's ok, it's all ok".The rock python will be released into the Baikanthapur forest near the Sahib Bari village that saw all that dramatic action Sunday afternoon.Many confessed they had their hearts in their mouth and thought the the forest ranger was a goner.Some thought he was a fool or at least foolhardy.And yet others felt he was very brave.

He never let go of the snake's neck even for a moment, said an admiring villager.A much less impressed West Bengal forest minister is believed to have ordered an inquiry into the incident.