The man accused of killing a New Zealand-born police officer Matiu Ratana in a London custody holding cell has gone on trial in Britain.
Louis De Zoysa, 25, denies killing Sergeant Ratana, 54, with a gun concealed in an underarm holster at Croydon Custody Centre in 2020.
"Louis De Zoysa pulled the trigger on purpose four times," prosecutors said.
Duncan Penny KC added De Zoysa "injured himself with the fourth shot".
The prosecution alleges Sergeant Ratana, who was also known as Matthew and was the on-duty custody sergeant, was killed while De Zoysa was handcuffed in a holding cell.
Penny told the jury De Zoysa bought the antique gun at an auction in June 2020, that it was legal to own, and he had made his own bullets because ammunition for it was no longer manufactured.
Officers who arrested and searched De Zoysa earlier in the day "did not find" he was carrying a loaded revolver in a holster, the court heard.
Penny told Northampton Crown Court: "The prosecution say Louis De Zoysa pointed his gun at Sergeant Ratana", and that he "pulled the trigger on purpose twice when he was pointing the gun at Sergeant Ratana".
"There is CCTV footage and other video of what happened," he added.
"The video and the audio shows Louis De Zoysa killing Matthew Ratana," the prosecutor said.
On the opening day of the case on Tuesday, the court heard the fourth shot hit De Zoysa in the neck, causing him to suffer brain damage.
As a result, he will be assisted by an intermediary during his trial and uses a whiteboard because of communication difficulties, the jurors were told.
"I am going to be talking in short sentences and simple words," Penny told the court on Wednesday. "This is so that Louis De Zoysa can understand what I am saying."
The prosecution opened their case by recounting the events that led up to the shooting.
It told the jury that: "On Friday 25 September 2020, Louis de Zoysa was walking along London Road, in Norbury."
He was stopped by the police and searched by officers on the street and handcuffed, the prosecution told jurors, who were also shown the officers' body-worn camera footage.
"The police officers found that Louis De Zoysa was carrying cannabis and seven rounds of ammunition but the police officers did not find that Louis De Zoysa was carrying a loaded revolver in a holster.
"The gun and holster were probably concealed under one of his armpits," the court was told.
De Zoysa, who was 23 at the time, was then taken to Croydon Police Station and put in a holding room, still handcuffed.
Jurors were told: "Louis De Zoysa kept the gun hidden and was able to point the gun at Sergeant Ratana," who was on duty.
"He deliberately shot Sergeant Ratana, once to the chest, at very close range. He did not give a warning."
The court heard the other officers present were not able to stop De Zoysa, and the shot caused a fatal injury to Ratana's left lung and heart. The prosecution says this was "deliberate".
Three further shots, including the one that injured De Zoysa, were fired during a struggle with the other officers, the court was told.
The prosecution alleges: "The second shot was another deliberate shot at Sergeant Ratana." That hit the officer in the leg.
The third shot hit the cell.
The prosecution told the court De Zoysa "must have been able to get hold of the gun after he was arrested and before he left the police van".
Defence barrister Imran Khan KC told jurors: "Louis De Zoysa says he did not mean to or want to kill Sergeant Ratana, or to cause him really serious harm.
"Louis De Zoysa says that he is not guilty of murder.
"The reason Louis De Zoysa says he is not guilty of murder is because at the time he was suffering from an abnormality of mental function.
"The abnormality of mental function that Louis De Zoysa was suffering was an autistic meltdown."
De Zoysa, of Banstead, Surrey, has pleaded not guilty to murder.