Michael James Whitelock has been sentenced to four and a half years jail for animal cruelty offences.

A dairy worker has been handed what is believed to be New Zealand's longest-ever prison sentence for animal cruelty, after cows were beaten, had their tails broken and were shot in the kneecaps on a farm he managed.

Michael James Whitelock was sentenced in the Greymouth District Court on Wednesday to four and a half years jail and banned from owning animals for 10 years.

He had earlier pleaded guilty to 12 charges, including ill treatment of animals, unlawful possession of firearms and attempting to pervert the course of justice.

The Ministry for Primary Industries (MPI) welcomed the sentence.

"This was one of the worst cases of cruelty MPI has dealt with," animal welfare manager Peter Hyde said.

"We take this sort of offending very seriously and the sentence indicates that the court clearly does too."

The sentence is believed to be the New Zealand's largest for animal cruelty. The next biggest was the two years and one month jail term handed down to a Waikato farmer in 2013, MPI said.

Whitelock was the dairy manager on a Landcorp farm near Westport from July 2012 until his suspension in September 2013. MPI began investigating that month after a Landcorp manager arranged for a vet to examine the herd.

Of the 1100 animals, 152 cows and 57 heifers had broken tails. The vet told investigators that he had never seen the number of animals with broken tails as he found at the Totara Dairy Unit on Cape Foulwind.

Investigators found the mistreatment of animals was widespread on the farm under Whitelock's management.

One cow due to be euthanised was walked to the offal pit where Whitelock gave a single-barrel shotgun to an employee and instructed him to shoot the cow in the legs. Whitelock and three employees each fired one shot at the cow's legs before it was euthanised.

MPI said Whitelock beat another cow with a fencing baton, which resulted in a traumatic eye injury. Whitelock then tried to euthanise the animal but failed and ended up putting it in the offal pit while it was still alive.

Three other offenders have been sentenced to community detention, community work and disqualification.