JAKARTA — Indonesian villagers armed with knives, hammers and clubs slaughtered 292 crocodiles in revenge for the death of a man killed by a crocodile at a breeding farm, an official said.

Photographs released by Antara news agency showed bloodied carcasses of the crocodiles in a large pile in the Sorong district of the eastern Indonesian province of West Papua.

The head of Indonesia’s Natural Resources Conservation Agency in West Papua said the 48-year-old victim had entered the crocodile farm and was likely picking grass for animal feed when he was attacked.

“An employee heard someone screaming for help, he quickly went there and saw a crocodile attacking someone,” Basar Manullang said in a statement.

After the burial of the man Saturday, villagers entered the farm and killed all the crocodiles, said Manullang.

Manullang said the farm had been given a license to breed protected saltwater and New Guinea crocodiles in 2013 for preservation and also to harvest some of the animals.

But one of the conditions was that the reptiles not disturb the community, he said.

“To prevent this from happening again, farming license holders need to secure surrounding areas,” said Manullang. He said his agency was coordinating with police in their investigation.

“Crocodiles are God’s creatures that need to be protected too,” Manullang said.