Twenty (20) prisoners who were standing trial in a South African magistrate court have escaped after the track carrying them to prison was ambushed by gunmen.

READ MORE: Police officer caught selling Indian hemp at post

And one of them has already been sentenced to 17 years imprisonment after he was convicted of armed robbery.

They were being taken to the Johannesburg Correctional Services prison when a group of men armed with rifles ambushed them at Pat Mbatha Road.

"The prisoners escaped after a truck was ambushed at Pat Mbatha Road near South Gate train station by a group of men armed with rifles," said Gauteng police spokesperson Lungelo Dlamini in a statement, eNCA has reported.

"A truck door lock was broken before the prisoners escaped."

Police officers were not injured during the ambush.

"One of the prisoners was already sentenced to 17 years imprisonment after he was convicted for an armed robbery. Several leads are being followed to arrest them,” Dlamini said.

Meanwhile South Africans have been reacting to the story.

READ MORE:Farmer remanded for raping married woman to appease gods

One man said: “Incompetency at its best, I sympathize with the communities where these prisoners have escaped to.”

And another said: “How many cops was protecting these scumbags in transit? Were they armed properly? Was the truck being followed by other officers of the law? Seems like an inside job here!”