Lieutenant Colonel Tembinkosi Kinana said on Tuesday that two unidentified men knocked on the sergeant's door at his Montclair home around 9pm on Monday.
They fired several shots at him as he approached the door and then entered the house, demanding his firearm in a safe.
They ran away and the officer died at the scene.
The 34-year-old officer was stationed at Philippi East.
A case of armed robbery and murder was being investigated and no arrests were made.
"The South African Police Service Management would like to convey heartfelt condolences to the bereaved family of the deceased police officer and to his colleagues at work," Kinana said.
"An attack to the police, is an attack to the society. Our efforts to serve and protect our communities will not be deterred by the cold blooded and heartless criminals. We will not be side-tracked by the criminal elements operating within our communities, and the police will not sleep until culprits are brought to book."
Other police deaths
Two police officers were shot dead in separate incidents in Cape Town on Sunday.
A 36-year-old constable was killed while on duty on Spine Road, Mitchells Plain, around 8pm on Sunday.
An hour later, a 40-year-old sergeant was shot in his Khayelitsha home while getting ready to go to work. He died on his way to hospital.
No arrests were made for either attack.
Police Minister Nathi Mthethwa visited Mitchell's Plain on Monday following the attacks.
In a phone interview, he said the province had the highest number of attacks on police.
He said the Western Cape community safety department's criticism of the police service reinforced the idea that officers did not deserve respect.
"What we are saying is that criticising the police is not a problem if they think there are weaknesses. But if they say nothing positive, they open them [the police] up to criminal attacks," he said.
"The major point we're making here is the issues of safety and security, like in any other province, is about working together and partnerships through a multi-disciplinary approach," Mthethwa said.
The city's community safety minister, Dan Plato, condemned the police minister's comments, accusing him of "playing politics" while people were being killed.
"It is utterly disgusting and totally inappropriate that the national minister would use the death of police officers for electioneering purposes," Plato said.
The Democratic Alliance (DA) accused Mthethwa on Monday of trying to score political points, calling his comments distasteful, insensitive and an insult to the grieving families.
"The only people to blame for the deaths of our police officers are criminals who have no respect for the police," DA MP Dianne Kohler-Barnard said.
She called on Mthethwa to retract his comments.
"[He must] stop abusing his position to make irresponsible statements. Instead, he should be proactive and launch an investigation into the causes and extent of police killings," Kohler-Barnard said.
The DA intended asking Parliament to summon Mthethwa to explain what he would do to better protect police officers in the Western Cape and the rest of the country. – Sapa