A Springs police official was asleep at his house in Strubenvale in the early hours of Friday morning when he heard his dogs barking.
He peeped through the window and saw two men opening his garage door, attempting to steel his motorcycle.
Captain Johannes Ramphora, Springs police spokesman, says the armed policeman went outside.
One of the robbers hit the policeman across one of his hands with a piece of iron.
Ramphora says the policeman fired two shots killing the one robber and injuring the other one.
The injured man jumped over the fence and ran away.
The policeman then called the police to the scene.
Ramphora says a case of murder and house break-in have been opened at the Springs Police Station and these cases are being investigated.