Thousands of chickens pecked a fox to death after it got locked inside their coop, French media reports.

The unlucky fox wandered into the enclosure and the door automatically locked behind.

"There was a herd instinct and they attacked him with their beaks," Pascal Daniel, head of farming at agricultural school Les Gros-Chêne in northwestern France, told AFP.

The six-month-old fox's body was found covered in "blows to its neck, blows from beaks" the next day.

"A whole mass of hens can arrive together and the fox may have panicked in the face of such a big number," Daniel told French paper Ouest France.

Last time a fox entered the coop, the fox won, he said - but the chickens have now know better.

"The hens have been there since July, so for more than seven months, and have probably learned to defend themselves. They can be quite tenacious when they are in a pack."

Last year chickens were introduced to Auckland's Great Barrier Island to take on the island's unwanted skink population.

Newshub.