A 23-foot-long python about to feast on an Indonesian security guard had the tables turned — and wound up as dinner for an entire village.

Robert Nababan, 37, encountered the monster snake as it blocked traffic in Riau Province on the island of Sumatra, the Telegraph UK reported.

He unwisely tried to move the scaly beast and ended up in the hospital after nearly getting his arm bitten off by its razor-sharp teeth.

“I tried to catch it. It bit my arm, and we wrestled for a while,” he said from his hospital bed. It’s unclear how, but Nababan eventually bested the snake, according to the report.

Villagers strung up the giant reptile between two poles and later fried up and feasted on its meat, the Daily Mail reported.

The snake was likely a reticulated python, the world’s largest reptile, capable of eating fully grown pigs, and sometimes humans.

In March, a 25-year-old farmer in Sulawesi was not as lucky, winding up in the stomach of a 23-foot-long reticulated python.