It took six men to subdue this gigantic python. Photo: Youtube.

A massive python was caught in western Indonesia recently after a local fisherman accidentally stepped on the snake, which he thought was a log.

Six local fishermen were passing through a jungle in Padang Pariaman in West Sumatra when one of them, Tan Galuang, accidentally stepped on a python nearly nine meters (27 feet) long, the UK Mirror reported.

The gigantic reptile tried to get away when the six men spotted it by a creek.

The python then wrapped itself around one of the men’s ankles. A scuffle ensued, but minutes later the men overpowered the python and held its mouth to prevent anyone getting bitten.

Galuang said that they were initially in the area looking for fish but realized that snakes are also valuable.

The huge python, which weighed almost 100 kilograms, ended up being kept in a large cage for several days before wildlife officers retrieved it and released the animal miles away from populated areas.

Pythons are non-venomous snakes but can still prove to be a threat when they wrap around their prey to crush them. They can grow up to 30 feet long, which makes them the longest snake on the planet.