This handout picture taken on September 30, 2017 and released on October 4, 2017 by the Batang Gansal Police shows villagers beside a 7.8 metre (25.6 foot) long python which was killed after it attacked an Indonesian man, nearly severing his arm, in the remote Batang Gansal subdistrict of Sumatra island.

A giant python attacked an Indonesian man, nearly severing his arm, before hungry villagers chopped up the reptile and ate it, a police chief said Wednesday.

Security guard Robert Nababan crossed paths with the giant creature while patrolling an oil palm plantation in the remote Batang Gansal subdistrict of Sumatra island on Saturday.

“The python was 7.8 metres long (25.6 feet), it was unbelievably huge,” local police chief Sutarja, who like many Indonesians only has one name, told AFP.

Sutarja said the 37-year-old Nababan, who sometimes liked to eat snake, tried to catch the giant python and stuff it in a gunny sack.

But the huge serpent fought back and bit him on his left arm, nearly severing it from his body.

Nababan was then rushed to a hospital in a neighbouring town for treatment.

The police chief said the intervention of another security guard and several local residents, one of whom hit the snake with a log, helped to save the man’s life.

Hungry locals later killed the snake and displayed its body in the village before dicing it up, frying it and feasting on it.

Giant python, which regularly top 20 feet in length, are commonly found in Indonesia and the Philippines.

In March, a 25-year-old Indonesian farmer has been discovered inside the belly of a giant python after the swollen snake was caught near where the man vanished while harvesting his crops on the eastern island of Sulawesi.