A South African court has cut the sentences of two white farmers who forced a black man into a coffin and threatened to kill him, sparking nationwide outrage.

South Africa is beset by deep-rooted racial inequality even after the end of white-minority rule in 1994 and racist incidents regularly erupt on social media.

Willem Oosthuizen and Theo Martins Jackson had been sentenced to 16 and 19 years in October 2017 after a video of their act in the eastern Mpumalanga province went viral.

They had pleaded not guilty and said the incident was only intended to scare Victor Mlotshwa, whom they accused of stealing copper cables from their farm.

The pair were convicted of attempted murder as well as kidnap, intimidation and assault with intent to do grievous bodily harm.

On Monday, the Supreme Court of Appeal set aside the convictions for attempted murder and intimidation, a move that effectively left them to serve five years instead.

"This Court has found that the appellants should have been convicted of assault with intent to do grievous bodily harm instead of attempted murder," Judge Yvonne Thokozile Mbatha said, sentencing each man to five years in prison.

"I have considered the rationale of sentencing, namely deterrence, retribution and rehabilitation," Mbatha said.

She also handed each man a one-year sentence for kidnapping, while Jackson received an additional year's imprisonment for defeating the ends of justice by assaulting the sole witness in an attempt to stop him from testifying.

Victor Mlotshwa, right, denied trespassing, saying he was taking a short cut to the shops
Victor Mlotshwa, right, denied trespassing, saying he was taking a short cut to the shops AFP / WIKUS DE WET

The shorter terms will run concurrently with the five-year sentence.

Two clips of the 2016 incident, taken on their mobile phones, showed the men shoving Mlotshwa down into the wooden coffin and pressing the lid with their boots as he begged for mercy.

They are also seen threatening to put a snake in the coffin.

Throughout the case, the men denied that their actions had caused the victim to fear for his life.

mgu/ach/ri