A court has been told that a gun was passed to Mark Duggan just 15 minutes before he was shot dead by police - the death that sparked last year's London riots.
The prosecution said Duggan was shot as a result of his possession of that weapon and what he was thought to be about to do with it.
Kevin Hutchinson-Foster, 30, is accused of supplying the gun and his trial began on Tuesday at Snaresbrook Crown Court.
Ronke Phillips reports.
Armed police shot Mark Duggan as he got out of a minicab holding the loaded gun and appeared to be about to shoot, the court heard.
The situation, which led to rioting in August last year, was "as dangerous a position as possible" for police marksmen, the court was told.
At the trial of the man accused of passing the handgun to Mr Duggan, the jury heard he collected it just 15 minutes before he was shot dead on August 4 2011.
The 29-year-old's death in Tottenham, north London, sparked riots that swept across the capital and the country.
Hutchinson-Foster is accused of passing the gun to Mr Duggan that same day.
The 30-year-old is charged with "selling or transferring a prohibited firearm" to Mr Duggan between July 28 and August 5, 2011.
Hutchinson-Foster, of no fixed abode, denies passing the BBM Bruni Model 92 handgun to Mr Duggan, contrary to the Firearms Act 1968.
The court heard that Mr Duggan had been under surveillance on August 4, as well as the previous day.
The prosecution claims he travelled in a minicab to collect the gun from Hutchinson-Foster in Leyton, east London, before continuing to Tottenham.
Opening the case, prosecutor Edward Brown QC said Mr Duggan was followed by armed police who decided to carry out a "hard stop".
– Prosecutor Edward Brown QC
The armed police surrounded the cab but as Mr Duggan got out he was seen to have the gun in his hand.
The police marksmen were in no doubt that this was as dangerous a position as possible - gun in hand, and he was seen to start to bring it round as if to shoot.
Mr Duggan was shot, Mr Brown said.
He fell to the ground fatally injured. From that moment until the ambulances and helicopter ambulance arrived they sought to resuscitate Mr Duggan but to no avail.