Riots have hit a small town in South Africa after a magistrate granted bail to two white farmers accused of murdering a 16-year-old black boy.

Anger erupted in the maize producing town of Coligny, after residents learned that the two suspects had been freed on Monday.

Three houses were torched and white-owned shops looted.

The violence over the death highlights prevailing racial tensions in parts of post-apartheid South Africa.

Apartheid was a legal system of discrimination that existed in South Africa until the country’s first democratic elections in 1994.

Pieter Doorewaad and Phillip Schutte allegedly assaulted Matlhomola Moshoeu and then threw him out of a moving car.

Pieter Doorewaard (L) and Phillip Schutte, who are accused of murdering 16-year-old Moswi Moshoeu.

Local media report that the two farmers caught Mr Moshoeu stealing sunflowers on a farm near to the township where he lived, took him hostage and assaulted him.

They, however, say he jumped off a truck as they were taking him to the police.

Magistrate Magaola Foso told the court that he was aware that the case had led to increased tensions in the area, but said he could not have an emotional response, the AFP news agency reports.

“There is no link between the said witness evidence and the two [accused] persons at this stage,” AFP quotes the magistrate as saying.

The teenager’s cause of death is not yet known because the results of his autopsy report have not been handed over to the court.

Journalists who were covering the violence were allegedly attacked by the owners of properties targeted by the rioters. They were accused of inciting violence by covering the events.

Meanwhile farmers in the area are said to be on high alert, worried that they might become the next target as tensions continue. The police say they are monitoring the situation.

The two men are due back in court on 26 June.