"There was an explosion on the vehicle," police brigadier Neville Malila told Talk Radio 702. "The explosive device that was used is still unknown."
He said two prisoners had been killed and 15 injured, but an emergency services worker later told Reuters that four prisoners had died at the scene and one had died en route to hospital.
Malila said the van had been transporting 36 prisoners to the Johannesburg Central Prison.
"It was an attempt to escape," Brig. Malila said. None of the prisoners succeeded in getting away, he said. At least one of the fleeing prisoners was shot and wounded by the police, he said.Prisons and police officials later told reporters that an investigation was under way to determine how the prisoners plotted to escape and what kind of explosive device was used.
Police Maj. Gen. Oswald Reddy said that "an unknown explosive device was detonated" as the vehicle approached the prison facility.
"It was very carefully planned," he said of the attempted escape.
According to the SAPA news agency, correctional services commissioner Tom Moyane said he was satisfied that all security measures were in place when the prisoners were transported to the court.
He said once the prisoners were in the van, they were the responsibility of the police. The police also claimed to have had all their security measures in place.
Moyane said officials were not ruling out the possibility of an inside job, and investigations will show how prisoners were able to hide the explosive device.
The explosion happened in transit at a trafic light near the prison police spokesperson Brigadier Neville Malila told AFP.
"When they arrived at the corner of Naturena and the Old Soweto Highway, the driver heard a big bang. He noted there was a hole in the door and saw two prisoners escape," he said.