A 23-year-old man died after he shot himself in the head at Protea Glen police station in Johannesburg on Friday.
Police spokesperson Captain Hector Netshivhodza said the man was a psychiatric patient, who had been chased into the police station by an unknown person.
"He tried to get behind the counter, but the officers on duty stopped him and told him to stand on the other side," Netshivhodza said.
"He then grabbed a firearm and tried to shoot one of the police officers, but the firearm was jammed. He tried again and fired the gun down the passage and then put the gun to the right side of his head and shot himself."
He added that the police officers who had witnessed the shooting were in shock and had received counselling.
An inquest docket has been opened and is under investigation.