A blast outside a prison in central Johannesburg Monday killed three prisoners and seriously wounded four others, a police official said.

Prisoners trying to escape from custody detonated an explosive device as a van traveling from court approached the Johannesburg Prison Monday afternoon, South African Police Brig. Neville Malila told The Associated Press. The blast shattered the van's door and then at least two prisoners tried to flee. Inside the van were 36 prisoners and two police officials, Malila said.

"It was an attempt to escape," 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 in Johannesburg 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 plan to escape.