“They abandoned the vehicle in Atteridgeville and hijacked a red Polo,” Lt-Col Khensani Magoai said.
“Police are still searching for the suspects.”
The two, who were due to appear in court, came out of the holding cells into the courtroom and started shooting earlier on Tuesday.
A court orderly was slightly wounded and the police officer who came to testify was seriously wounded, Magoai said.
Earlier, ER24 paramedics said the police officer was shot in the head.
The two men, who were appearing on charges of house robbery and possession of unlicensed firearms, escaped.
The police statement sought to clarify initial uncertainty about what happened.
Police officers, court officials, and reporters milled around outside the court after the shooting. Just before midday the court’s main entrance on Frances Baard Street was opened and people started filing back into the building.