Rory O’Brien, aged 60, of Killicane, Mitchelstown, Co Cork, had pleaded guilty at Cork Circuit Criminal Court to five counts of animal cruelty at his farm on dates between May and September 2011.

O’Brien had been indicted on 32 counts — three in respect of the welfare of animals, two for failing to comply with a notice, and 27 for cruelty — and similar charges were brought against his wife and the farm manager.

However, on the morning of his trial he pleaded guilty to five counts on a full facts basis and the remaining charges against all three accused were withdrawn by the DPP.

He was sentenced to 18 months in prison by Judge Seán Ó Donnabháin on February 12.

Moving yesterday to appeal his sentence, Ken Fogarty, counsel for O’Brien, submitted that the trial judge was “clearly influenced” by facts relating to counts which were not before the court.

The sentencing judge referred to 17,000 pigs and “cruelty on an industrial scale” but there were only three animals involved in the cruelty to which O’Brien had pleaded guilty, Mr Fogarty said.

Speaking on behalf of the three-judge Court of Appeal yesterday, Mr Justice Garrett Sheehan said the court wished to emphasise that it acknowledged these offences as “extremely serious”.

“That goes without saying and the facts of this case speak for themselves.” However, it was undoubtedly a fact also that O’Brien was under considerable pressure at the time, the judge said.

The court heard he was €22m in debt, was effectively “bankrupt”, and struggling to wind down his business at the time.

Mr Justice Sheehan said the sentencing judge was “perfectly correct” in holding that a custodial sentence was necessary and the Court of Appeal endorsed that view.

However, in identifying an error in his sentence, Mr Justice Sheehan said O’Brien was entitled to have his personal qualities and contributions to his community taken into account as mitigating factors.

O’Brien is a 60-year-old married man with a grown-up family who had clearly worked hard all his life and had a previous good character, the judge said.

At one stage he employed 40 people and was making a serious contribution to a particularly important agricultural industry, he added.

Mr Justice Sheehan, who sat with Mr Justice George Birmingham and Mr Justice Alan Mahon, said the court would leave the original sentence of 18 months in place but would suspend the final six months.