"In prison you can rape prisoners if you feel like it; at least you won't be around little children," magistrate Herman Badenhorst was quoted as telling Neo Molaudzi on Monday.
Molaudzi reportedly attacked the teenager, who is now 14, while he walking to school in September 2012. He threatened the youth with a piece of broken glass and pulled him into an alley where he raped him and robbed him of R10.
According to Beeld, Molaudzi, 22, said he was sorry for the crimes and that he felt "under pressure from the court", but at the same time denied raping the boy.
'Danger to community'
Badenhorst reportedly said: "You forgot your semen was found on the boy. You have already been convicted, I'm sure you feel under pressure."
Molaudzi had previously repeatedly been convicted of burglary and theft. "You are clearly a danger and I need you out of the community as long as possible," Badenhorst said.
The newspaper reported that Molaudzi asked for leave to appeal, but Badenhorst refused and said the DNA evidence was overwhelming, the rapist's testimony had been false and he had tried to mislead the court.