The police officer who shot Mark Duggan in north London has told a court he was "absolutely 100%" sure the 29-year-old was holding a gun.
The marksman, identified only as V53, said he could make out the shape of the gun, which he said Mr Duggan was holding in his right hand.
V53 was giving evidence in the trial of Kevin Hutchinson-Foster, 30, at Snaresbrook Crown Court.
Mr Hutchinson-Foster denies giving Mr Duggan an illegal handgun.
Previously the court heard that on 4 August 2011 officers followed the minicab Mr Duggan was in and saw it stop at a house in Leyton where Mr Hutchinson-Foster is alleged to have given him a gun in a cardboard shoebox.
Mr Duggan then continued on to Ferry Lane, Tottenham, north London, where the vehicle was intercepted and he was shot.
The fatal shooting first sparked unrest in Tottenham which later turned into a riot, eventually spreading across London and to other parts of England.
Giving evidence V53 said he was "approximately five metres" away from Mr Duggan when the two shots were fired.
Explaining why he "rapidly acquired shoot procedure", he said: "I saw him hold the gun in his right hand, side-on to his stomach, and begin to move the barrel away from his body.
"I perceived this to be the beginning of him raising the gun into the aim position, whereby he would shoot at me or one of my colleagues.
"I had an honest-held belief that Mark Duggan was going to shoot me or one of my colleagues, so I brought my MP5 (sub-machine gun) up to the shooting position."
'Shoot to stop'
He added: "August 4 will always be in my head.
"It's very clear, even now."
The officer, who has 15 years' experience, said he was aware that criminals sometimes use a sock to conceal a handgun.
He said there was a black sock covering the firearm Mark Duggan was carrying.
Officers were trained to "shoot to stop" and Mr Duggan was shot after he left the minicab, he added.
The Metropolitan Police officer said: "The gun was still in his hand as I fired the round which impacted on his right chest."
Mr Duggan then made "a flinching movement" which V53 said caused his body to move to the right.
He added: "He's still holding the gun, and the gun is pointing towards my direction.
"I'm thinking he's going to shoot me or one of my colleagues so I fire a second round of my MP5.
"This has hit him on his right bicep.
"Mark Duggan then fell to the floor. I then closed the suspect down."
The gun was no longer in his hand and V53 said he heard another armed officer, identified only as W42, say "I'm hit, I'm hit".
V53, who was the only team medic present, said his fellow officer was his "primary concern".
He said: "I knew it was one of my rounds", adding that the bullet which hit Mr Duggan had "over-penetrated" - gone through the body, before hitting W42.
But the bullet did not injure W42 as it hit his radio, the jury heard.
V53 then turned his attention to Mr Duggan and gave CPR for 15 minutes until paramedics arrived at the scene.
W42 told the court the impact of the bullet hitting the radio "knocked the wind out of me".
"It was as though I was kicked fully in the side, in the upper ribs area," he said.
The trial continues.