Police fired rubber bullets at mobs of schoolchildren who went on the rampage outside the Protea Magistrate's Court on Friday, attempting to rob passers-by and blocking traffic.
A Nyala slowly drove past the hundreds of students, with police officers firing a few shots from inside the armoured vehicle.
It was enough to send the students fleeing, leaving them waiting on the perimeter of the park across from the court building.
Hundreds of schoolchildren arrived at the court around 9.30am in a third day of protests against hip-hop artist Molemo "Jub Jub" Maarohanye and Themba Tshabalala, accused of killing four schoolchildren in a drag racing accident.
Aggressive protesters, some dressed in school uniform, attempted to rob a man on a bicycle but eventually let him go.
Others accosted a bread truck and managed to open its back door. One of the protesters grabbed a bread loaf before the truck sped off. The loaf was flung into the air.
Johannesburg metro police officers arrived on the scene later to support police officials who were pointing shot guns loaded with rubber bullets at the children.
The protesters tried to block cars from passing through the street in front of the court.
They were singing, "we are not afraid of you", and, "the things you are doing are not right".
Some tried to force their way onto the court premises but were stopped by police.
Inside the court, the State argued that the pair should not be granted bail for several reasons, including their safety and public safety.
"The outrage of the community may lead to public disorder if they are released," said State prosecutor Liezl van Jaarsveld.
Maarohanye and Tshabalala are facing charges of murder, attempted murder and reckless and drunken driving after an alleged drag racing accident on March 8 that killed four pupils and critically injured two others. -Sapa